<div dir="ltr">Seems to be fixed, thanks Nicolas.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Dec 13, 2013 at 3:53 PM,  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Nicolas Cellier uploaded a new version of MorphicExtras to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/MorphicExtras-nice.138.mcz" target="_blank">http://source.squeak.org/trunk/MorphicExtras-nice.138.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: MorphicExtras-nice.138<br>
Author: nice<br>
Time: 13 December 2013, 10:52:51.312 pm<br>
UUID: 7341d071-8e59-4440-a218-079102d11bfe<br>
Ancestors: MorphicExtras-nice.137<br>
<br>
PaintBoxMorph re-engineering:<br>
1) Initialize more PaintBoxMorph newPrototype instance variables.<br>
2) Remove unused colorPatch instance variable.<br>
  The two methods in which it appears are unsent, or more exactly they both have an alternate implementor which only send to self.<br>
3) Avoid highlighting the brush buttons onImage with a cyan/light blue square again and again.<br>
  The Prototype is already highlighted.<br>
  Move this highlighting in prototype initialization.<br>
<br>
=============== Diff against MorphicExtras-nice.137 ===============<br>
<br>
Item was changed:<br>
  ImageMorph subclass: #PaintBoxMorph<br>
+       instanceVariableNames: &#39;action tool currentCursor thumbnail currentColor currentBrush colorMemory stampHolder rotationTabForm scaleTabForm colorMemoryThin brushes focusMorph weakDependents recentColors&#39;<br>

-       instanceVariableNames: &#39;action tool currentCursor thumbnail currentColor currentBrush colorMemory colorPatch stampHolder rotationTabForm scaleTabForm colorMemoryThin brushes focusMorph weakDependents recentColors&#39;<br>

        classVariableNames: &#39;AllOffImage AllOnImage AllPressedImage ColorChart ImageLibrary OriginalBounds Prototype RecentColors UseLargeColorPicker&#39;<br>
        poolDictionaries: &#39;&#39;<br>
        category: &#39;MorphicExtras-Support&#39;!<br>
<br>
Item was changed:<br>
  ----- Method: PaintBoxMorph class&gt;&gt;new (in category &#39;instance creation&#39;) -----<br>
  new<br>
<br>
        | pb |<br>
        pb := self prototype veryDeepCopy.<br>
                &quot;Assume that the PaintBox does not contain any scripted Players!!&quot;<br>
        pb stampHolder normalize.       &quot;Get the stamps to show&quot;<br>
        &quot;Get my own copies of the brushes so I can modify them&quot;<br>
+       #(brush1: brush2: brush3: brush4: brush5: brush6:) do: [:sel | | dualUse button |<br>
-       #(brush1: brush2: brush3: brush4: brush5: brush6:) do: [:sel | | dualUse formCanvas rect button |<br>
                button := pb submorphNamed: sel.<br>
                button offImage: button offImage deepCopy.<br>
                dualUse := button onImage == button pressedImage.       &quot;sometimes shared&quot;<br>
                button onImage: button onImage deepCopy.<br>
                dualUse<br>
                        ifTrue: [button pressedImage: button onImage]<br>
                        ifFalse: [button pressedImage: button pressedImage deepCopy].<br>
-               &quot;force color maps for later mapping&quot;<br>
-               button offImage.<br>
-               button onImage.<br>
-               button pressedImage.<br>
-               formCanvas := button onImage getCanvas.<br>
-               formCanvas := formCanvas<br>
-                       copyOrigin: 0@0<br>
-                       clipRect: (rect := 0@0 extent: button onImage extent).<br>
-               (#(brush1: brush3:) includes: sel) ifTrue: [<br>
-                       rect := rect origin corner: rect corner - (2@2)].<br>
-               (#brush2: == sel) ifTrue: [<br>
-                       rect := rect origin corner: rect corner - (2@4)].<br>
-               formCanvas frameAndFillRectangle: rect fillColor: Color transparent<br>
-                       borderWidth: 2 borderColor: (Color r: 0.599 g: 0.8 b: 1.0).<br>
                ].<br>
        pb showColor.<br>
        pb fixUpRecentColors.<br>
        pb addLabels.<br>
        ^ pb!<br>
<br>
Item was added:<br>
+ ----- Method: PaintBoxMorph&gt;&gt;addBrushesOffImage: (in category &#39;initialization&#39;) -----<br>
+ addBrushesOffImage: offImage<br>
+       | posSpec |<br>
+       posSpec := #(<br>
+               (13 37 64 13 37 64) &quot;offset X&quot;<br>
+               (107 107 107 124 124 124) &quot;offset Y&quot;<br>
+               (21 24 27 21 24 27) &quot;width&quot;<br>
+               (18 18 18 25 25 25) &quot;height&quot;).<br>
+       #(brush1: brush2: brush3: brush4: brush5: brush6: ) keysAndValuesDo: [:index :name |<br>
+               | button nib rect on off |<br>
+               (self submorphNamed: name) ifNil:<br>
+                       [nib := Form dotOfSize: (#(1 2 3 6 11 26) at: index).<br>
+                       rect := ((posSpec at: 1) at: index) @ ((posSpec at: 2) at: index)<br>
+                                       extent: ((posSpec at: 3) at: index) @ ((posSpec at: 4) at: index).<br>
+                       off := (offImage copy: rect) as8BitColorForm.<br>
+                       &quot;highlight a frame&quot;<br>
+                       on := off deepCopy.<br>
+                       (on getCanvas copyOrigin: 0@0 clipRect: (0@0 extent: rect extent))<br>
+                               frameAndFillRectangle: (0@0 extent: rect extent) fillColor: Color transparent<br>
+                               borderWidth: 2 borderColor: (Color r: 0.6 g: 0.8 b: 1.0).<br>
+                       (button := ThreePhaseButtonMorph new)<br>
+                               onImage: on;<br>
+                               offImage: off;<br>
+                               pressedImage: on;<br>
+                               bounds: (rect translateBy: self position);<br>
+                               setNamePropertyTo: name;<br>
+                               actionSelector: #brush:action:nib:evt:;<br>
+                                       arguments: (Array with: button with: name with: nib);<br>
+                               actWhen: #buttonUp; target: self.<br>
+                       self addMorph: button.]].<br>
+       brushes := #(brush1: brush2: brush3: brush4: brush5: brush6: ) collect: [:name | self submorphNamed: name].<br>
+       currentBrush := brushes last.<br>
+       currentBrush state: #on.<br>
+<br>
+ !<br>
<br>
Item was removed:<br>
- ----- Method: PaintBoxMorph&gt;&gt;addBrushesOffImage:onImage: (in category &#39;initialization&#39;) -----<br>
- addBrushesOffImage: offImage onImage: onImage<br>
-       | posSpec |<br>
-       posSpec := #(<br>
-               (13 36 63 13 36 63) &quot;offset X&quot;<br>
-               (107 107 107 124 124 124) &quot;offset Y&quot;<br>
-               (21 24 27 21 24 27) &quot;width&quot;<br>
-               (18 18 18 25 25 25) &quot;height&quot;).<br>
-       #(brush1: brush2: brush3: brush4: brush5: brush6: ) keysAndValuesDo: [:index :name |<br>
-               | button nib rect |<br>
-               (self submorphNamed: name) ifNil:<br>
-                       [nib := Form dotOfSize: (#(1 2 3 6 11 26) at: index).<br>
-                       rect := ((posSpec at: 1) at: index) @ ((posSpec at: 2) at: index)<br>
-                                       extent: ((posSpec at: 3) at: index) @ ((posSpec at: 4) at: index).<br>
-                       (button := ThreePhaseButtonMorph new)<br>
-                               onImage: (onImage copy: rect) as8BitColorForm;<br>
-                               offImage: (offImage copy: rect) as8BitColorForm;<br>
-                               pressedImage: (onImage copy: rect) as8BitColorForm;<br>
-                               bounds: (rect translateBy: self position);<br>
-                               setNamePropertyTo: name;<br>
-                               actionSelector: #brush:action:nib:evt:;<br>
-                                       arguments: (Array with: button with: name with: nib);<br>
-                               actWhen: #buttonUp; target: self.<br>
-                       self addMorph: button.]].<br>
-       brushes := #(brush1: brush2: brush3: brush4: brush5: brush6: ) collect: [:name | self submorphNamed: name]<br>
-<br>
- !<br>
<br>
Item was changed:<br>
  ----- Method: PaintBoxMorph&gt;&gt;addToolsOffImage:onImage: (in category &#39;initialization&#39;) -----<br>
  addToolsOffImage: offImage onImage: onImage<br>
        | posSpec actionSpec iconSpec |<br>
        posSpec := #(<br>
                (13 53 13 53) &quot;offset X&quot;<br>
                (13 13 61 61) &quot;offset Y&quot;<br>
                (40 40 40 40) &quot;width&quot;<br>
                (48 48 44 44) &quot;height&quot;).<br>
        actionSpec := #(tool:action:cursor:evt: tool:action:cursor:evt: eyedropper:action:cursor:evt: tool:action:cursor:evt:).<br>
        iconSpec := #(paintIcon fillIcon eyedropperIcon eraseIcon).<br>
        #(paint: fill: eyedropper: erase:) keysAndValuesDo: [:index :name |<br>
                | button rect |<br>
                (self submorphNamed: name) ifNil:<br>
                        [rect := ((posSpec at: 1) at: index) @ ((posSpec at: 2) at: index)<br>
                                        extent: ((posSpec at: 3) at: index) @ ((posSpec at: 4) at: index).<br>
                        (button := ThreePhaseButtonMorph new)<br>
                                onImage: (onImage copy: rect);<br>
                                offImage: (offImage copy: rect);<br>
                                pressedImage: (onImage copy: rect);<br>
                                bounds: (rect translateBy: self position);<br>
                                setNamePropertyTo: name;<br>
                                actionSelector: (actionSpec at: index);<br>
                                        arguments: (Array with: button with: name with: (self class perform: (iconSpec at: index)));<br>
                                actWhen: #buttonUp; target: self.<br>
+                       index = 1<br>
+                               ifTrue:<br>
+                                       [action := name.<br>
+                                       tool := button.<br>
+                                       currentCursor := button arguments at: 3].<br>
                        self addMorph: button.]].<br>
<br>
  !<br>
<br>
Item was changed:<br>
  ----- Method: PaintBoxMorph&gt;&gt;buildAPrototype (in category &#39;initialization&#39;) -----<br>
  buildAPrototype<br>
        | onImage |<br>
        self initialize.<br>
        self image: self class paletteImage.<br>
        rotationTabForm := self class rotationTabImage.<br>
        scaleTabForm := self class scaleTabImage.<br>
        (colorMemoryThin := self class colorMemoryThinImage asMorph)<br>
                setNamePropertyTo: &#39;ColorPickerClosed&#39;;<br>
                position: self position + (11@150);<br>
                on: #mouseEnter send: #showColorPalette: to: self.<br>
        self addMorph: colorMemoryThin.<br>
        (colorMemory := PaintBoxColorPicker new image: self class colorMemoryImage)<br>
                setNamePropertyTo: &#39;ColorPickerOpened&#39;;<br>
                on: #mouseDown send: #takeColorEvt:from: to: self.<br>
+       currentColor := Color transparent.<br>
<br>
        onImage := self class paletteOnImage.<br>
        self<br>
                addToolsOffImage: image onImage: onImage;<br>
+               addBrushesOffImage: image;<br>
-               addBrushesOffImage: image onImage: onImage;<br>
                addActionsOffImage: image onImage: onImage;<br>
                addStampsAndShapes;<br>
                addShapeButtonsOffImage: self class shapesImage onImage: self class shapesOnImage;<br>
                addStampButtonsOffImage: self class stampsImage onImage: self class stampsOnImage.<br>
+       stampHolder := ScrollingToolHolder newPrototypeFor: self.!<br>
-       stampHolder := ScrollingToolHolder newPrototypeFor: self.<br>
-       currentBrush := brushes at: 1.!<br>
<br>
Item was removed:<br>
- ----- Method: PaintBoxMorph&gt;&gt;colorPatch (in category &#39;other&#39;) -----<br>
- colorPatch<br>
-       ^ colorPatch!<br>
<br>
Item was removed:<br>
- ----- Method: PaintBoxMorph&gt;&gt;indicateColorUnderMouse (in category &#39;actions&#39;) -----<br>
- indicateColorUnderMouse<br>
-       &quot;Track the mouse with the special eyedropper cursor, and accept whatever color is under the mouse as the currently-chosen color; reflect that choice in the feedback box, and return that color.&quot;<br>
-<br>
-       | pt feedbackColor |<br>
-       pt := Sensor cursorPoint.<br>
-       &quot;deal with the fact that 32 bit displays may have garbage in the alpha bits&quot;<br>
-       feedbackColor := Display depth = 32<br>
-               ifTrue: [ Color colorFromPixelValue: ((Display pixelValueAt: pt) bitOr: 16rFF000000) depth: 32]                 ifFalse: [Display colorAt: pt].<br>
-<br>
-       self activeHand position: pt.<br>
-       self world displayWorldSafely.<br>
-       Display fill: colorPatch bounds fillColor: feedbackColor.<br>
-       ^ feedbackColor !<br>
<br>
<br>
</blockquote></div><br></div>