[BUG?] Postscript Output mirrored?
Marcel Weiher
marcel at metaobject.com
Thu Sep 23 11:02:55 UTC 1999
> From: Alexander Lazarevic <Alexander at Lazarevic.de>
>
> When I write a World to a Postscript file with
> worldAsPostscriptRotated: I get an upside-down and mirrored
> picture. Nothing changes when I set the rotateFlag to true.
The rotateFlag hadn't been connected yet. Attached below are some
(very) quick (and dirty!) fixes that should do the trick for now.
Also, you might want to (should) use EPSCanvas to do 'screen grabs'.
(FileStream newFileNamed: '/tmp/Squeak-Rules.eps')
nextPutAll: (EPSCanvas
worldAsPostscriptRotated:true); close.
Looking at the Postscript output, there also seems to be some
page-setup code missing. I'll look into it after I've gotten updates
from the server.
Regards,
Marcel
PostscriptCanvas class methods
worldAsPostscriptRotated:rotateFlag
^self morphAsPostscript:World rotated:rotateFlag
offsetBy:(rotateFlag ifTrue:[0 at 0] ifFalse:[self baseOffset]).
morphAsPostscript:aMorph rotated:rotateFlag offsetBy:offset
| psCanvas bounds |
psCanvas _ self new.
psCanvas reset.
psCanvas bounds:(offset extent:aMorph bounds extent).
rotateFlag ifTrue:[
bounds _ psCanvas bounds.
bounds _ bounds topLeft extent: bounds height @ bounds width.
psCanvas bounds:bounds.
].
psCanvas topLevelMorph:aMorph.
psCanvas resetContent.
rotateFlag ifTrue:[
psCanvas target print:' 90 rotate 0 '; write:bounds width
negated; print:' translate'; cr.
].
psCanvas fullDrawMorph: aMorph .
^psCanvas contents.
More information about the Squeak-dev
mailing list
|