Blair,
Digging though my loose methods, I ran across my dusty old
#setViewportOrigin:, complete with comment to use #origin:. The two look
similar, except that I have a test on the return value. Is there a
performance and/or "it's never gonna happen" argument against such a test?
I won't defend what I did (return nil vs. throw an exception), but, I think
#origin: probably should look at the return value.
Have a good one,
Bill
!Canvas methodsFor!
setViewportOrigin:aPoint
"Move the origin from its current location to the indicated point,
answering
the previous origin, or nil on error."
| oldPoint |
#wksSafe.
#deprecated. "Use Canvas>>origin: instead!!"
oldPoint := POINTL new.
^( GDILibrary default setViewportOrgEx:self asParameter X:aPoint x Y:aPoint
y lpPoint:oldPoint )
ifTrue:[ oldPoint asPoint ]
ifFalse:[ nil ]! !
!Canvas categoriesFor:
#setViewportOrigin:!*-deprecated!*-unclassified!public! !
!Canvas methodsFor!
origin: aPoint
"Sets the origin offset for drawing within the receiver to
be aPoint. Answers the previous origin"
| previous |
previous := POINTL new.
GDILibrary default
setViewportOrgEx: self asParameter nXOrg: aPoint x nYOrg: aPoint y lppt:
previous asParameter.
^previous asPoint
! !
!Canvas categoriesFor: #origin:!operations!public! !
--
Wilhelm K. Schwab, Ph.D.
[hidden email]