Skip to content

Commit 3965934

Browse files
authored
Fix bug in image layer (#667)
1 parent 86f2d75 commit 3965934

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/essence/Basics/Layers_/Layers_.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -587,13 +587,16 @@ const L_ = {
587587
}
588588

589589
if (s.type === 'image') {
590-
L_.layers.layer[s.name].clearCache()
591-
L_.layers.layer[s.name].updateColors(
592-
L_.layers.layer[s.name].options
593-
.pixelValuesToColorFn
594-
)
595-
// Redraw the layer or the image will not refresh again unless zooming in/out
596-
L_.layers.layer[s.name].redraw()
590+
if (L_.layers.layer[s.name].options.pixelValuesToColorFn
591+
&& L_.layers.layer[s.name].options.pixelValuesToColorFn !== null) {
592+
L_.layers.layer[s.name].clearCache()
593+
L_.layers.layer[s.name].updateColors(
594+
L_.layers.layer[s.name].options
595+
.pixelValuesToColorFn
596+
)
597+
// Redraw the layer or the image will not refresh again unless zooming in/out
598+
L_.layers.layer[s.name].redraw()
599+
}
597600
}
598601

599602
if (s.type === 'vector') {

0 commit comments

Comments
 (0)