#BUGFIX by cg draft
authorClaus Gittinger <cg@exept.de>
Mon, 20 Mar 2017 16:23:49 +0100
changeset 3430 9b5190f88556
parent 3429 bda211bf56ec
child 3431 ecac7d4db6d0
#BUGFIX by cg class: ImageEditor changed: #update:with:from:
ImageEditor.st
--- a/ImageEditor.st	Sat Mar 18 19:05:37 2017 +0100
+++ b/ImageEditor.st	Mon Mar 20 16:23:49 2017 +0100
@@ -5065,14 +5065,22 @@
                 clrIndex := clrIndex - 1.
             ].
             changedColor := changedObject at:aParameter.
-            drawingColormap notNil ifTrue:[
-                drawingColormap at:clrIndex put:changedColor.
-            ].
             cMap := image colorMap.
             (cMap notNil and:[cMap isFixedPalette not]) ifTrue:[
                 image colorMap at:clrIndex put:changedColor.
                 self colorMapChanged.
-            ].
+            ] ifFalse:[
+                drawingColormap notNil ifTrue:[
+                    drawingColormap size < clrIndex ifTrue:[
+                        |newDrawingColormap|
+                        
+                        newDrawingColormap := drawingColormap species new:clrIndex.
+                        newDrawingColormap replaceFrom:1 with:drawingColormap.
+                        drawingColormap := newDrawingColormap.
+                    ].    
+                    drawingColormap at:clrIndex put:changedColor.
+                ].
+            ].    
             ^ self
         ].
         ^ self
@@ -5135,7 +5143,7 @@
 
     super update:something with:aParameter from:changedObject
 
-    "Modified (comment): / 17-02-2017 / 14:28:01 / cg"
+    "Modified: / 20-03-2017 / 16:05:55 / cg"
 !
 
 updateAfterImageChange