[squeak-dev] The Trunk: Morphic-mt.1181.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Jun 15 09:21:18 UTC 2016
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1181.mcz
==================== Summary ====================
Name: Morphic-mt.1181
Author: mt
Time: 15 June 2016, 11:20:40.050378 am
UUID: 855f8338-73de-5947-9dc5-99e912d115a2
Ancestors: Morphic-mt.1180
ixes regression in event dispatching and coordinate transformations. Do not reset transformation in the event copy delivered to submorphs. They need those for, e.g., double click, drag-and-drop, etc.
Our events do, more or less, not change after being created and initialized. The only exception is #wasHandled, #wasIgnored, and #position during event dispatching. Keep it that way. If you plan to change some event state in an event filter, create a new event instead and do not mess around with the current one.
=============== Diff against Morphic-mt.1180 ===============
Item was changed:
----- Method: MorphicEventDispatcher>>dispatchEvent:toSubmorphsOf: (in category 'private') -----
dispatchEvent: anEvent toSubmorphsOf: aMorph
+ "Dispatch the given event to the submorphs of the given morph. For coordinate transformations, work only with copies. Either return the given event or a copy of any filtered event to employ immutability to some extent. --- PRIVATE!!"
- "Dispatch the given event to the submorphs of the given morph. --- PRIVATE!!"
+ | localEvent filteredEvent |
- | filteredEvent |
aMorph submorphsDo: [:child |
+ localEvent := anEvent transformedBy: (child transformedFrom: aMorph).
filteredEvent := child
+ processEvent: localEvent
- processEvent: (anEvent transformedBy: (child transformedFrom: aMorph))
using: self. "use same dispatcher"
+ filteredEvent == #rejected ifFalse: [ "some event or #rejected symbol"
+ self flag: #overlappingChildren. "mt: We cannot give two overlapping siblings the chance to handle the event!!"
+ filteredEvent == localEvent
+ ifTrue: [
+ localEvent wasHandled ifTrue: [anEvent copyHandlerState: localEvent].
+ anEvent wasIgnored: localEvent wasIgnored.
+ ^ anEvent]
+ ifFalse: [
+ filteredEvent := filteredEvent copy.
+ filteredEvent translateTo: anEvent position. "restore to untransformed coordinates"
+ filteredEvent wasHandled ifFalse: [filteredEvent copyHandlerState: anEvent]. "restore handler if needed"
+ ^ filteredEvent]]].
- filteredEvent == #rejected ifFalse: [ "filteredEvent or #rejected"
- filteredEvent translateTo: anEvent position. "restore to untransformed coordinates"
- filteredEvent wasHandled ifFalse: [filteredEvent copyHandlerState: anEvent]. "restore handler if needed"
- self flag: #overlappingChildren. "mt: We cannot give two overlapping siblings the chance to handle the event!!"
- ^ filteredEvent]].
^ #rejected!
More information about the Squeak-dev
mailing list
|