The Trunk: Morphic-mt.1749.mcz

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

The Trunk: Morphic-mt.1749.mcz

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

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

Name: Morphic-mt.1749
Author: mt
Time: 14 April 2021, 9:16:54.322665 am
UUID: ef4ada4c-49e7-0e47-8666-65f157b4a83f
Ancestors: Morphic-mt.1748

Fixes a small regression in halo dispatching, which concerns rendered morphs (i.e., the ones wrapped in TransformationMorph such as when rotated.)

=============== Diff against Morphic-mt.1748 ===============

Item was changed:
  ----- Method: MorphicHaloDispatcher>>dispatchHalo:transferInwardsFrom: (in category 'dispatching') -----
  dispatchHalo: event transferInwardsFrom: currentTarget
 
  | localEvent world |
+ "Note that a halo usually attaches to the outermost (or top) renderer in a composition around the rendered morph. Thus, we have to lookup that inner (or rendered) morph first when transferring the halo inwards in the hierarchy of submorphs."
+ currentTarget renderedMorph submorphsDo: [:nextTarget |
- currentTarget submorphsDo: [:nextTarget |
  localEvent := event transformedBy: (nextTarget transformedFrom: currentTarget).
  (nextTarget fullContainsPoint: localEvent position) ifTrue: [
  ^ nextTarget wantsHaloFromClick
  ifTrue: [self invokeHalo: localEvent on: nextTarget]
  ifFalse: [self dispatchHalo: localEvent transferInwardsFrom: nextTarget]]].
 
  "We're at the bottom most level; throw the event back up to the root to find recipient"
  event hand removeHalo.
  Preferences maintainHalos ifFalse: [
  (world := currentTarget world) ifNil: [ ^ false ].
  localEvent := event transformedBy: (currentTarget transformedFrom: world) inverseTransformation.
  world processEvent: localEvent resetHandlerFields].
 
  ^ false!

Item was changed:
  ----- Method: MorphicHaloDispatcher>>dispatchHalo:transferOutwardsFrom: (in category 'dispatching') -----
  dispatchHalo: event transferOutwardsFrom: currentTarget
 
  | localEvent |
+ "Note that a halo usually handles composite renderers through the outermost (or top) renderer. So, we can directly use the renderer's owner to transfer a halo outwards in the hierarchy of morphs."
+ "self assert: [currentTarget == currentTarget topRendererOrSelf]."
  currentTarget owner ifNotNil: [:nextTarget |
  localEvent := event transformedBy: (currentTarget transformedFrom: nextTarget).
  "Never transfer halo to top-most world"
  ^ (nextTarget isWorldMorph not and: [nextTarget wantsHaloFromClick])
  ifTrue: [self invokeHalo: localEvent on: nextTarget]
  ifFalse: [self dispatchHalo: localEvent transferOutwardsFrom: nextTarget]].
 
  "We're at the top level; throw the event back in to find recipient"
  event hand removeHalo.
  currentTarget isWorldMorph
  ifTrue: [currentTarget processEvent: event copy resetHandlerFields].
 
  ^ false!