[RFI]Having flip metods again in image (was [BUG] Missing methods
in 3.4 beta)
Lic. Edgar J. De Cleene
edgardec2001 at yahoo.com.ar
Mon Jan 12 22:48:26 UTC 2004
Skipped content of type multipart/alternative-------------- next part --------------
'From Squeak3.4gamma of ''7 January 2003'' [latest update: #5168] on 6 February 2003 at 9:27:08 am'!
!PolygonMorph methodsFor: 'geometry' stamp: 'edc 3/20/2002 14:24'!
flipHAroundX: centerX
"Flip me horizontally around the center. If centerX is nil, compute my center of gravity."
| cent |
cent _ centerX
ifNil: [bounds center x
"cent _ 0.
vertices do: [:each | cent _ cent + each x].
cent asFloat / vertices size"] "average is the center"
ifNotNil: [centerX].
self setVertices: (vertices collect: [:vv |
((vv x - cent) * -1 + cent) @ vv y]) reversed.! !
!PolygonMorph methodsFor: 'geometry' stamp: 'sw 9/14/97 18:22'!
flipVAroundY: centerY
"Flip me vertically around the center. If centerY is nil, compute my center of gravity."
| cent |
cent _ centerY
ifNil: [bounds center y
"cent _ 0.
vertices do: [:each | cent _ cent + each y].
cent asFloat / vertices size"] "average is the center"
ifNotNil: [centerY].
self setVertices: (vertices collect: [:vv |
vv x @ ((vv y - cent) * -1 + cent)]) reversed.! !
More information about the Squeak-dev
mailing list
|