[Etoys] [FIX]Position of picked up tile morph

Karl karl.ramberg at chello.se
Sat Dec 2 06:07:38 EST 2006


Some tiles (like a new script) get a big offset when they are picked up 
from the viewer. To me it seems like a a feature that is obsolete. I 
commented out the offset part and the look and feel is more consistent.
Karl
-------------- next part --------------
'From OLPC2.0 of ''24 October 2006'' [latest update: #1134] on 2 December 2006 at 12:02:51 pm'!

!PhraseTileMorph methodsFor: 'mouse' stamp: 'kfr 12/2/2006 12:01'!
mouseDown: evt 
	"Handle a mouse-down on the receiver"

	| ed guyToTake dup enclosingPhrase |
	self removeHighlightFeedback.
	self isPartsDonor ifTrue:
		[dup _ self duplicate.
		dup eventHandler: nil.   "Remove viewer-related evt mouseover feedback"
		evt hand attachMorph: dup.
		dup position: evt position" + (-25 at 8)".
		"So that the drag vs. click logic works"
		dup formerPosition: evt position.
		^ self].
	submorphs isEmpty
		ifTrue: [^ self].

	guyToTake _ self.
	[(enclosingPhrase _ guyToTake ownerThatIsA: PhraseTileMorph) notNil] whileTrue:
		[guyToTake _ enclosingPhrase].  "This logic always grabs the outermost phrase, for now anyway"
	
	"the below had comment: 'picking me out of another phrase'"
	"owner class == TilePadMorph
		ifTrue:
			[(ss _ submorphs first) class == TilePadMorph
				ifTrue: [ss _ ss submorphs first].
			guyToTake _  ss veryDeepCopy]."

	(ed _ self enclosingEditor) ifNil: [^ evt hand grabMorph: guyToTake].
	evt hand grabMorph: guyToTake.
	ed startStepping.
	ed mouseEnterDragging: evt.
	ed setProperty: #justPickedUpPhrase toValue: true.
! !



More information about the Etoys mailing list