The Trunk: Morphic-mt.1176.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.1176.mcz

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

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

Name: Morphic-mt.1176
Author: mt
Time: 11 June 2016, 11:12:09.425012 am
UUID: c5d33955-e9e9-0c4b-a0c4-7427c3050cc0
Ancestors: Morphic-mt.1175

Fixes a bug with duplicate handling of morphic drop events. This bug has been there for a long time but showed itself only recently because we recently fixed event bubbling for drop events and focus events.

Thanks to Tim (R.) for pointing out this bug during his efforts to port Scratch 1.4 to Squeak Trunk.

=============== Diff against Morphic-mt.1175 ===============

Item was changed:
  ----- Method: Morph>>handleDropMorph: (in category 'events-processing') -----
  handleDropMorph: anEvent
  "Handle a dropping morph."
  | aMorph localPt |
+ anEvent wasHandled ifTrue: [^ self]. "Not interested"
  aMorph := anEvent contents.
  "Do a symmetric check if both morphs like each other"
  ((self wantsDroppedMorph: aMorph event: anEvent) "I want her"
  and: [aMorph wantsToBeDroppedInto: self]) "she wants me"
  ifFalse: [aMorph removeProperty: #undoGrabCommand.
  ^ self].
  anEvent wasHandled: true.
  "Transform the morph into the receiver's coordinate frame. This is currently incomplete since it only takes the offset into account where it really should take the entire transform."
  localPt := (self transformedFrom: anEvent hand world) "full transform down"
  globalPointToLocal: aMorph referencePosition.
  aMorph referencePosition: localPt.
  self acceptDroppingMorph: aMorph event: anEvent.
  aMorph justDroppedInto: self event: anEvent.
  !