'From Cuis 1.0 of 19 May 2009 [latest update: #201] on 19 May 2009 at 11:39:08 pm'!

!Morph methodsFor: 'geometry eToy' stamp: 'jmv 5/19/2009 23:24'!
referencePosition
	"Return the current reference position of the receiver"
	| box |
	box _ self bounds.
	^box origin + (0.5@0.5 * box extent).
! !


!PolygonMorph methodsFor: 'halo control' stamp: 'jmv 5/19/2009 23:36'!
rotationDegrees: degrees 
	| flex center |
	center _ self bounds center.
	flex _ (MorphicTransform offset: center negated)
			withAngle: (degrees - self forwardDirection) degreesToRadians.
	self setVertices: (vertices collect: [:v | (flex transform: v) - flex offset]).
	self forwardDirection: degrees.

! !

!PolygonMorph methodsFor: 'private' stamp: 'jmv 5/19/2009 23:35'!
privateMoveBy: delta
	super privateMoveBy: delta.
	vertices _ vertices collect: [:p | p + delta].
	self arrowForms do: [:f | f offset: f offset + delta].
	curveState _ nil.  "Force recomputation"! !


!SketchMorph methodsFor: 'accessing' stamp: 'jmv 5/19/2009 23:25'!
form: aForm
	"Set the receiver's form"

	| oldForm |
	oldForm _ originalForm.
	originalForm _ aForm.
	self layoutChanged.

	oldForm ifNotNil: [self position: self position + (oldForm extent - aForm extent // 2)].
! !

!SketchMorph methodsFor: 'accessing' stamp: 'jmv 5/19/2009 23:25'!
nominalForm: aForm
	"Ascribe the blank nominal form"

	originalForm _ aForm.
	self layoutChanged
! !

!SketchMorph methodsFor: 'initialization' stamp: 'jmv 5/19/2009 23:25'!
initializeWith: aForm

	super initialize.
	originalForm _ aForm.
	rotationStyle _ #normal.		"styles: #normal, #leftRight, #upDown, or #none"
	scalePoint _ 1.0@1.0.
	framesToDwell _ 1.
	rotatedForm _ originalForm.	"cached rotation of originalForm"
	self extent: originalForm extent.
! !

PolygonMorph removeSelector: #referencePosition!
PolygonMorph removeSelector: #rotationCenter!
PolygonMorph removeSelector: #rotationCenter:!
Morph removeSelector: #rotationCenter!
Morph removeSelector: #rotationCenter:!
