'From Squeak3.5alpha of ''7 January 2003'' [latest update: #5169] on 13 February 2003 at 6:27:33 pm'!
"Change Set: MorphGeometryTweaks-efc
Date: 13 February 2003
Author: Eddie Cottongim
Changes the morph geometry methods #topLeft, #topRight, #bottomLeft, and #bottomRight so that they result in #position being called only once.
Also adds a number of method comments to the Morph geometry methods."!
!Morph methodsFor: 'geometry' stamp: 'efc 2/13/2003 18:17'!
bottom
" Return the y-coordinate of my bottom side "
^ bounds bottom! !
!Morph methodsFor: 'geometry' stamp: 'efc 2/13/2003 18:14'!
bottom: aNumber
" Move me so that my bottom is at the y-coordinate aNumber. My extent (width & height) are unchanged "
self position: (bounds left @ (aNumber - self height))! !
!Morph methodsFor: 'geometry' stamp: 'efc 2/13/2003 18:08'!
bottomLeft: aPoint
" Move me so that my bottom left corner is at aPoint. My extent (width & height) are unchanged "
self position: ((aPoint x) @ (aPoint y - self height)).
! !
!Morph methodsFor: 'geometry' stamp: 'efc 2/13/2003 18:09'!
bottomRight: aPoint
" Move me so that my bottom right corner is at aPoint. My extent (width & height) are unchanged "
self position: ((aPoint x - bounds width) @ (aPoint y - self height))
! !
!Morph methodsFor: 'geometry' stamp: 'efc 2/13/2003 18:22'!
height: aNumber
" Set my height; my position (top-left corner) and width will remain the same "
self extent: self width@aNumber asInteger.
! !
!Morph methodsFor: 'geometry' stamp: 'efc 2/13/2003 18:16'!
left
" Return the x-coordinate of my left side "
^ bounds left! !
!Morph methodsFor: 'geometry' stamp: 'efc 2/13/2003 18:15'!
left: aNumber
" Move me so that my left side is at the x-coordinate aNumber. My extent (width & height) are unchanged "
self position: (aNumber @ bounds top)! !
!Morph methodsFor: 'geometry' stamp: 'efc 2/13/2003 18:16'!
right
" Return the x-coordinate of my right side "
^ bounds right! !
!Morph methodsFor: 'geometry' stamp: 'efc 2/13/2003 18:15'!
right: aNumber
" Move me so that my right side is at the x-coordinate aNumber. My extent (width & height) are unchanged "
self position: ((aNumber - bounds width) @ bounds top)! !
!Morph methodsFor: 'geometry' stamp: 'efc 2/13/2003 18:17'!
top
" Return the y-coordinate of my top side "
^ bounds top! !
!Morph methodsFor: 'geometry' stamp: 'efc 2/13/2003 18:14'!
top: aNumber
" Move me so that my top is at the y-coordinate aNumber. My extent (width & height) are unchanged "
self position: (bounds left @ aNumber)! !
!Morph methodsFor: 'geometry' stamp: 'efc 2/13/2003 18:10'!
topLeft: aPoint
" Move me so that my top left corner is at aPoint. My extent (width & height) are unchanged "
self position: aPoint
! !
!Morph methodsFor: 'geometry' stamp: 'efc 2/13/2003 18:12'!
topRight: aPoint
" Move me so that my top right corner is at aPoint. My extent (width & height) are unchanged "
self position: ((aPoint x - bounds width) @ (aPoint y))
! !
!Morph methodsFor: 'geometry' stamp: 'efc 2/13/2003 18:22'!
width: aNumber
" Set my width; my position (top-left corner) and height will remain the same "
self extent: aNumber asInteger@self height.
! !