#OTHER
authorClaus Gittinger <cg@exept.de>
Mon, 05 Oct 2015 09:19:46 +0200
changeset 4853 ee048f425b2b
parent 4852 0083a73c33c5
child 4854 23fe12653489
#OTHER class: ImageEditView changed: #buttonPress:x:y: #selectedColor: #selectedColorIndex: care for invalid button index
ImageEditView.st
--- a/ImageEditView.st	Sun Oct 04 12:35:47 2015 +0200
+++ b/ImageEditView.st	Mon Oct 05 09:19:46 2015 +0200
@@ -366,7 +366,7 @@
 !
 
 selectedColor: aColor
-    (drawingColorHolders at:mouseKeyColorMode) value:aColor
+    (drawingColorHolders at:(mouseKeyColorMode min:drawingColorHolders size)) value:aColor
 !
 
 selectedColorIndex
@@ -374,7 +374,7 @@
 !
 
 selectedColorIndex: aPixelIndex
-    (drawingPixelHolders at:mouseKeyColorMode) value: aPixelIndex
+    (drawingPixelHolders at:(mouseKeyColorMode min:drawingPixelHolders size)) value: aPixelIndex
 !
 
 setModified
@@ -816,20 +816,22 @@
             self changed:#selectedColor with:clr.
         ] ifFalse:[
             readOnly ifFalse:[
-                mouseKeyColorMode := button.
-                self makeUndo.
-
-                clickInfoCallBack notNil ifTrue:[
-                    "/ still a kludge, but less ugly ...
-                    clickInfoCallBack value:button value:p
-                ].
-                "/ editMode is something like #point, #rectangle etc.
-                [
-                    self perform: (editMode, 'At:') asSymbol with:p
-                ] on:Error do:[:ex | 
-                    (Dialog confirm:('Error during operation: ', ex description,'\\Debug ?') withCRs )
-                    ifTrue:[
-                        ex reject
+                (button between:1 and:2) ifTrue:[
+                    mouseKeyColorMode := button.
+                    self makeUndo.
+
+                    clickInfoCallBack notNil ifTrue:[
+                        "/ still a kludge, but less ugly ...
+                        clickInfoCallBack value:button value:p
+                    ].
+                    "/ editMode is something like #point, #rectangle etc.
+                    [
+                        self perform: (editMode, 'At:') asSymbol with:p
+                    ] on:Error do:[:ex | 
+                        (Dialog confirm:('Error during operation: ', ex description,'\\Debug ?') withCRs )
+                        ifTrue:[
+                            ex reject
+                        ].
                     ].
                 ].
             ].
@@ -2859,11 +2861,11 @@
 !ImageEditView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/ImageEditView.st,v 1.266 2015-03-26 09:35:43 cg Exp $'
+    ^ '$Header$'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg2/ImageEditView.st,v 1.266 2015-03-26 09:35:43 cg Exp $'
+    ^ '$Header$'
 ! !