Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!news.cs.indiana.edu!ux1.cso.uiuc.edu!jason From: jason@ux1.cso.uiuc.edu (Jason Watts) Newsgroups: comp.sys.mac.programmer Subject: Re: GlobalToLocal() LocalToGlobal() information Message-ID: <1991Mar8.090224.14194@ux1.cso.uiuc.edu> Date: 8 Mar 91 09:02:24 GMT References: <3744.27CD13AE@stjhmc.fidonet.org> <23417@well.sf.ca.us> <1991Mar7.203748.20407@jato.jpl.nasa.gov> Organization: University of Illinois at Urbana Lines: 23 dundas@granite.jpl.nasa.gov (John Dundas) writes: >In MPW, the following macros perform the equivalent function to their >ROM counterparts. >#define GLOBALTOLOCAL(_pt) (((Point * )(_pt))->h += qd.thePort->portBits.bounds.left), \ > (((Point * )(_pt))->v += qd.thePort->portBits.bounds.top) >#define LOCALTOGLOBAL(_pt) (((Point * )(_pt))->h += -qd.thePort->portBits.bounds.left), \ > (((Point * )(_pt))->v += -qd.thePort->portBits.bounds.top) I don't know what this note is responding to, as I missed the beginning of this thread. But, at any rate, it seems like these definitions won't work if qd.thePort is a color port. In such a case ( **( ( CGrafPtr ) qd.thePort )->portPixMap ).bounds would need to be substituted for qd.thePort->portBits.bounds. -- | | |====================| | | | Jason Watts | \ |\ |\ \ | (jazzin@uiuc.edu) | \| \| \|\|====================|