'From Cuis 2.0 of 24 February 2010 [latest update: #440] on 11 March 2010 at 5:59:52 pm'!
!classDefinition: #TransformMorph category: #'Morphic-Basic'!
Morph subclass: #TransformMorph
	instanceVariableNames: 'transform localBounds txOffset '
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Morphic-Basic'!

!TransformMorph methodsFor: 'accessing' stamp: 'jmv 3/11/2010 17:59'!
offset: newOffset
	| o |
	o _ newOffset - self innerBounds topLeft.
	transform offset = o ifFalse: [
		transform _ transform withOffset: o.
		txOffset _ o.
		self changed ]! !

!TransformMorph methodsFor: 'initialization' stamp: 'jmv 3/11/2010 17:44'!
initialize
	"initialize the state of the receiver"
	super initialize.
	transform _ MorphicTransform identity.
	txOffset _ 0@0! !

!TransformMorph methodsFor: 'private' stamp: 'jmv 3/11/2010 17:43'!
initTxOffset
	txOffset ifNil: [
		txOffset _ transform
			ifNotNil: [transform offset ]
			ifNil: [ 0@0 ]]! !

!TransformMorph methodsFor: 'private' stamp: 'jmv 3/11/2010 17:59'!
privateFullMoveBy: delta
	"Private!! Relocate me, but not my subMorphs."

	self privateMoveBy: delta.
	transform _ transform withOffset: (transform offset - delta).
	txOffset _ txOffset - delta
! !

!classDefinition: #TransformMorph category: #'Morphic-Basic'!
Morph subclass: #TransformMorph
	instanceVariableNames: 'txOffset transform localBounds'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Morphic-Basic'!
"Postscript:
Leave the line above, and replace the rest of this comment by a useful one.
Executable statements should follow this comment, and should
be separated by periods, with no exclamation points (!!).
Be sure to put any further comments in double-quotes, like this one."
TransformMorph allInstancesDo: [ :each | each initTxOffset ]!

