Article View: comp.sys.mac
Article #13821Re: QuickDraw Request
From: Richard Siegel
Date: Mon, 17 Nov 1986 01:33
Date: Mon, 17 Nov 1986 01:33
32 lines
1600 bytes
1600 bytes
[Line-Eater? What line-eater? *chomp* 8-)]
SetRect and OffsetRect are two entirely different operations.
SetRect fills the fields of a rectangle with values, to initialize it. If you
try to use OffsetRect on an uninitialized rectangle, you get garbage.
OffsetRect is useful for moving a rectangle by a certain distance
horizontally and/or vertically; the same thing could be achieved by adding
the offsets into all fields of your rectangle:
{
r.top += voffset;
r.bottom += voffset;
r.left += hoffset;
r.right += hoffset;
}
I would suspect that OffsetRect does much the same thing, so the efficiency
gain by using OffsetRect versus the above 4 lines of code is minimal, if
there is anything.
To rehash: use SetRect to initialize a rectangle (or you could fill the
fields by hand, it's only a difference in readability. To move a rectangle,
use either OffsetRect (for readability), or else use those 4 lines of code
above...
Hope this helps out.
--Rich
Technical Details
Message-ID:
<MS.V3.17.rs4u.80020d16.dunmore.ibm032.616.1@andrew.cmu.edu>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!sri-unix!hplabs!ucbvax!ANDREW.CMU.EDU!rs4u#Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!rutgers!sri-unix!hplabs!ucbvax!ANDREW.CMU.EDU!rs4u# From: rs4u#@ANDREW.CMU.EDU (Richard Siegel) Newsgroups: comp.sys.mac Subject: Re: QuickDraw Request Message-ID: <MS.V3.17.rs4u.80020d16.dunmore.ibm032.616.1@andrew.cmu.edu> Date: Sun, 16-Nov-86 20:33:22 EST Article-I.D.: andrew.MS.V3.17.rs4u.80020d16.dunmore.ibm032.616.1 Posted: Sun Nov 16 20:33:22 1986 Date-Received: Mon, 17-Nov-86 02:04:30 EST Sender: daemon@ucbvax.BERKELEY.EDU Organization: University of California at Berkeley Lines: 32