fix: textureImage is not defined

This commit is contained in:
Azgaar 2023-08-08 17:07:10 +04:00
parent 1847270482
commit f7cb157cf3
4 changed files with 7 additions and 7 deletions

View file

@ -1518,8 +1518,9 @@ function toggleTexture(event) {
if (!layerIsOn("toggleTexture")) {
turnButtonOn("toggleTexture");
// href is not set directly to avoid image loading when layer is off
const src = texture.select("image").attr("src");
texture.select("image").attr("href", src);
const textureImage = byId("textureImage");
if (textureImage) textureImage.setAttribute("href", textureImage.getAttribute("src"));
if (event && isCtrlClick(event)) editStyle("texture");
} else {
if (event && isCtrlClick(event)) return editStyle("texture");