Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!mips!apple!sun-barr!newstop!sun!wind!naughton From: naughton@wind.Sun.COM (Patrick Naughton) Newsgroups: comp.windows.news Subject: Re: getbbox operator Message-ID: <131241@sun.Eng.Sun.COM> Date: 5 Feb 90 20:41:34 GMT References: <16503@boulder.Colorado.EDU> Sender: news@sun.Eng.Sun.COM Reply-To: naughton@Eng.sun.com (Patrick Naughton) Organization: Sun Microsystems, Mountain View Lines: 35 >>> The Openwindows code is using a new, apparently undocumented >>> operator called getbbox. >>> It signature seems to be this: >>> canvas bool => x y w h >>> where at least the w and h depend on the current scale. >>> Can anyone enlighten me as to the semantics of getbbox? >>> -Dennis Heimbigner >>> (dennis@boulder.colorado.edu) I'm not sure why it wasn't documented, but here's what it does: canvas|string true => llx lly urx ury canvas|string false => llx lly w h These return the bounding box of the canvas or string in the current ctm. The 'false' case simply does the subtraction of the lower-left from the upper-right and returns the width and height, suitable for passing to 'rectpath'. PS> /cv framebuffer newcanvas def PS> 0 0 100 200 rectpath cv reshapecanvas PS> 300 400 cv movecanvas PS> cv false getbbox pstack clear 300.0 400.0 100.0 200.0 PS> cv setcanvas PS> cv false getbbox pstack clear 0.0 0.0 100.0 200.0 PS> (Hello) false getbbox pstack clear 0.0 0.0 34.0 9.0 -Patrick ______________________________________________________________________ Patrick J. Naughton ARPA: naughton@sun.com Window Systems Group UUCP: ...!sun!naughton Sun Microsystems, Inc. AT&T: (415) 336 - 1080