'From Squeak3.1alpha of 5 February 2001 [latest update: #3531] on 6 February 2001 at 8:12:53 pm'! "Change Set: tileTweaks-sw Date: 6 February 2001 Author: Scott Wallace Fixes the recent bug that kept tile scripts from getting recompiled when a phrase was grabbed out from a Scriptor. Also fixes a glitch in the toggling between tiles and text in a Scriptor for the case where the tile script is empty."! !HandMorph methodsFor: 'grabbing/dropping' stamp: 'sw 2/6/2001 20:00'! grabMorph: aMorph from: formerOwner "Grab the given morph (i.e., add it to this hand and remove it from its current owner) without changing its position. This is used to pick up a morph under the hand's current position, versus attachMorph: which is used to pick up a morph that may not be near this hand." | grabbed offset targetPoint grabTransform fullTransform editor | self releaseMouseFocus. "Break focus" grabbed _ aMorph. "Compute the transform to apply to the grabbed morph" grabTransform _ formerOwner ifNil: [IdentityTransform new] ifNotNil: [formerOwner grabTransform]. "Compute the full transform for the grabbed morph" fullTransform _ formerOwner ifNil: [IdentityTransform new] ifNotNil: [formerOwner transformFrom: owner]. "targetPoint is point in aMorphs reference frame" targetPoint _ fullTransform globalPointToLocal: self position. "but current position will be determined by grabTransform, so compute offset" offset _ targetPoint - (grabTransform globalPointToLocal: self position). "apply the transform that should be used after grabbing" grabbed _ grabbed transformedBy: grabTransform. grabbed == aMorph ifFalse: [grabbed setProperty: #addedFlexAtGrab toValue: true]. "offset target to compensate for differences in transforms" grabbed position: grabbed position - offset asIntegerPoint. "And compute distance from hand's position" targetOffset _ grabbed position - self position. grabbed renderedMorph isTileLike ifTrue: [editor _ grabbed renderedMorph topEditor]. self addMorphBack: grabbed. editor ifNotNil: [editor scriptEdited]! ! !UniclassScript methodsFor: 'versions' stamp: 'sw 2/6/2001 20:12'! saveScriptVersion: timeStamp "Save the tile script version by appending a pair of the form