The Trunk: MorphicExtras-mt.171.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: MorphicExtras-mt.171.mcz

commits-2
Marcel Taeumel uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-mt.171.mcz

==================== Summary ====================

Name: MorphicExtras-mt.171
Author: mt
Time: 19 April 2016, 1:06:17.613134 pm
UUID: 5f029570-c24b-9f4b-b371-0f70d4f9fcbb
Ancestors: MorphicExtras-mt.170

Improves usage of #refreshWorld to avoid direct calls to #displayWorldSafely, which requires a check whether the morph in in a world or not.

=============== Diff against MorphicExtras-mt.170 ===============

Item was changed:
  ----- Method: PaintBoxMorph>>eyedropper:action:cursor:evt: (in category 'actions') -----
  eyedropper: aButton action: aSelector cursor: aCursor evt: evt
  "Take total control and pick up a color!!!!"
 
  | pt feedbackColor delay |
  delay := Delay forMilliseconds: 10.
  aButton state: #on.
  tool ifNotNil: [tool state: #off].
  currentCursor := aCursor.
  evt hand showTemporaryCursor: currentCursor
  hotSpotOffset: 6 negated @ 4 negated.
  "<<<< the form was changed a bit??"
  feedbackColor := Display colorAt: Sensor cursorPoint.
  colorMemory align: colorMemory bounds topRight
  with: colorMemoryThin bounds topRight.
  self addMorphFront: colorMemory.
 
  "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"
  evt hand position: pt.
  currentColor ~= feedbackColor ifTrue: [
  currentColor := feedbackColor.
  self showColor ].
+ self refreshWorld.
- self world displayWorldSafely.
  delay wait].
 
  "Now wait for the button to be released."
  [Sensor anyButtonPressed] whileTrue:
  [ pt := Sensor cursorPoint.
  "the hand needs to be drawn"
  evt hand position: pt.
+ self refreshWorld.
- self world displayWorldSafely.
  delay wait].
 
  evt hand showTemporaryCursor: nil hotSpotOffset: 0 @ 0.
  self currentColor: feedbackColor evt: evt.
  colorMemory delete.
  tool ifNotNil:
  [tool state: #on.
  currentCursor := tool arguments third].
  aButton state: #off
  !