[FIX]PaintBoxMorph placing of colorPickerPalette

Karl Ramberg karl.ramberg at chello.se
Thu Jul 13 21:12:25 UTC 2000


When you paint and the first tool you use is the color picker the color picker
palette places wrong. This fixes this.

Karl
-------------- next part --------------
'From Squeak2.9alpha of 13 June 2000 [latest update: #2447] on 13 July 2000 at 11:08:24 pm'!

!PaintBoxMorph methodsFor: 'actions' stamp: 'kfr 7/13/2000 23:05'!
eyedropper: aButton action: aSelector cursor: aCursor 
        "Take total control and pick up a color!!!!"
        | pt feedbackColor |
        aButton state: #on.
        tool ifNotNil: [tool state: #off].
        currentCursor _ aCursor.
        self activeHand
                showTemporaryCursor: currentCursor 
                hotSpotOffset: 6 negated @ 4 negated.    "<<<< the form was changed a bit??"
        feedbackColor _ Display colorAt: Sensor cursorPoint.
        self showColorPalette.
        "Full color picker"
        [Sensor anyButtonPressed]
                whileFalse: 
                        [pt _ Sensor cursorPoint.

                        "deal with the fact that 32 bit displays may have garbage in the alpha bits"
                        feedbackColor _ Display depth = 32 ifTrue: [
                                Color colorFromPixelValue: ((Display pixelValueAt: pt)
														bitOr: 16rFF000000) depth: 32
                        ] ifFalse: [
                                Display colorAt: pt
                        ].

                        "the hand needs to be drawn"
                        self activeHand position: pt.
                        self world displayWorldSafely.
                        Display fill: colorPatch bounds fillColor: feedbackColor].
        Sensor waitNoButton.
        self activeHand showTemporaryCursor: nil hotSpotOffset: 0 @ 0.
        self currentColor: feedbackColor.
        colorMemory delete.
		 
        tool
                ifNotNil: 
                        [tool state: #on.
                        currentCursor _ tool arguments at: 3].

        aButton state: #off! !

!PaintBoxMorph methodsFor: 'actions' stamp: 'kfr 7/13/2000 23:07'!
showColorPalette

	colorMemory align: colorMemory bounds topRight 
			with: colorMemoryThin bounds topRight.
	self addMorphFront: colorMemory.
	! !



More information about the Squeak-dev mailing list