'From Squeak5.2alpha of 9 June 2018 [latest update: #18067] on 11 June 2018 at 8:55:11 am'!


!Morph methodsFor: 'compatibility' stamp: 'di 10/1/2000 11:50'!
heading
	"Return the receiver's heading (in eToy terms)"
	owner ifNil: [^ self forwardDirection].
	^ self forwardDirection + owner degreesOfFlex! !

!Morph methodsFor: 'compatibility' stamp: 'ar 9/22/2000 13:37'!
heading: newHeading
	"Set the receiver's heading (in eToy terms)"
	self isFlexed ifFalse:[self addFlexShell].
	owner rotationDegrees: (newHeading - self forwardDirection).! !

!Morph methodsFor: 'compatibility' stamp: 'ar 9/22/2000 20:12'!
referencePosition
	"Return the current reference position of the receiver"
	| box |
	box := self bounds.
	^box origin + (self rotationCenter * box extent).
! !

!Morph methodsFor: 'compatibility' stamp: 'ar 9/27/2000 14:04'!
referencePosition: aPosition
	"Move the receiver to match its reference position with aPosition"
	| newPos intPos |
	newPos := self position + (aPosition - self referencePosition).
	intPos := newPos asIntegerPoint.
	newPos = intPos 
		ifTrue:[self position: intPos]
		ifFalse:[self position: newPos].! !

!Morph methodsFor: 'compatibility' stamp: 'ar 9/22/2000 20:10'!
rotationCenter
	"Return the rotation center of the receiver. The rotation center defines the relative offset inside the receiver's bounds for locating the reference position."
	^self valueOfProperty: #rotationCenter ifAbsent:[0.5@0.5]
! !

!Morph methodsFor: 'compatibility' stamp: 'ar 9/22/2000 20:11'!
rotationCenter: aPointOrNil
	"Set the new rotation center of the receiver. The rotation center defines the relative offset inside the receiver's bounds for locating the reference position."
	aPointOrNil isNil
		ifTrue:[self removeProperty: #rotationCenter]
		ifFalse:[self setProperty: #rotationCenter toValue: aPointOrNil]
! !

!Morph methodsFor: 'compatibility' stamp: 'Richo 2/21/2012 21:29'!
rotationDegrees: aFloat 
	^ self heading: aFloat! !
