[Pkg] The Trunk: Morphic-cmm.1462.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Sep 4 01:58:33 UTC 2018
Chris Muller uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-cmm.1462.mcz
==================== Summary ====================
Name: Morphic-cmm.1462
Author: cmm
Time: 3 September 2018, 8:57:57.317349 pm
UUID: 048b437d-9cac-4a1e-a0e9-0e672aca738f
Ancestors: Morphic-kfr.1460
Fix halo-invocation on rotated morphs.
=============== Diff against Morphic-kfr.1460 ===============
Item was changed:
----- Method: PasteUpMorph>>tryInvokeHalo: (in category 'events-processing') -----
tryInvokeHalo: aUserInputEvent
"Invoke halos around the top-most world container at aUserInputEvent's #position. If it was already halo'd, zero-in on its next inward component morph at that position. Holding Shift during the click reverses this traversal order."
| stack innermost haloTarget |
Preferences noviceMode ifTrue: [ ^ self ].
Morph haloForAll ifFalse: [ ^ self ].
"the stack is the top-most morph to bottom-most."
stack := (self morphsAt: aUserInputEvent position unlocked: true) select:
[ : each | each wantsHaloFromClick or: [ each handlesMouseDown: aUserInputEvent ] ].
innermost := aUserInputEvent hand halo
ifNil: [ stack first ]
ifNotNil:
[ : existingHalo | stack allButFirst "existingHalo is first on the stack, not a target"
detect: [ : each | each owner == self ]
ifFound:
[ : worldContainer | "Is existingHalo's target part of the same worldContainer as the morph clicked?"
(existingHalo target withAllOwners includes: worldContainer)
ifTrue: [ "same hierarchy, let #transferHalo: continue to handle it for now." ^ self ]
ifFalse:
[ "different hierarchy, remove + add."
aUserInputEvent hand removeHalo.
aUserInputEvent shiftPressed
ifTrue: [ stack second "first is still the just removed halo" ]
ifFalse: [ worldContainer ] ] ]
ifNone: [ "Shouldn't get here, but defensive code." self ] ].
"If modifier key is pressed, start at innermost (the target), otherwise the outermost (direct child of the world (self))."
+ haloTarget := (innermost == self or: [aUserInputEvent shiftPressed])
- haloTarget := aUserInputEvent shiftPressed
ifTrue: [ innermost ]
+ ifFalse:
+ [ "Find the outermost owner that wants it."
+ innermost withAllOwners reversed allButFirst
+ detect: [ : each | each wantsHaloFromClick ]
+ ifNone: [ "haloTarget has its own mouseDown handler, don't halo." ^ self ] ].
- ifFalse: [ innermost == self ifTrue: [innermost] ifFalse: [(innermost withAllOwners copyWithout: self) last] ].
- haloTarget wantsHaloFromClick ifFalse: [ "haloTarget has its own event handler." ^ self ].
"Now that we have the haloTarget, show the halo."
aUserInputEvent hand
newMouseFocus: haloTarget
event: aUserInputEvent.
haloTarget invokeHaloOrMove: aUserInputEvent.
"aUserInputEvent has been consumed, don't let it cause any further side-effects."
aUserInputEvent ignore!
More information about the Packages
mailing list