home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!swrinde!gatech!destroyer!gumby!kzoo!k044477
- From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
- Subject: Re: QuickDraw: Why Can't it Mirror Right?
- Message-ID: <1993Jan6.172330.3883@hobbes.kzoo.edu>
- Organization: Kalamazoo College
- References: <1993Jan5.191918.12324@fsl.noaa.gov> <C0F8rz.8Iw@panix.com>
- Date: Wed, 6 Jan 1993 17:23:30 GMT
- Lines: 47
-
- rmah@panix.com (Robert Mah) writes:
- >urban@yoda.fsl.noaa.gov (Art Urban) writes:
- >
- >>If I draw a line from 0,0 down and to the left, why won't QuickDraw mirror
- >>the line when I draw it down and to the *right*?
- >
- >The reason is that the coordinates you are passing to QuickDraw routines are
- >NOT pixel locations. They are the locations BETWEEN pixels.
- >
- >Thus, if you draw a line from (0,0) to (4,0), with a pensize of (1,1), it
- >will be 5 pixels long. But if you draw (0,0) to (-4,0) with a pensize of
- >(1,1), the line will be still be 5 pixels long, but have a RIGHT location
- >at coordinate 1. The key is that the "pen" hangs down and to the right of
- >the "pen location". And LINE drawing takes place using the pen.
- >
- >You should re-read the beginning of the Quickdraw chapter in IM-I for a
- >much clearer description of the graphics model used within QD.
-
- And Jon Waette comments:
- >Maybe because the pen has a physical size, and its centre is
- >not placed on the grid intersection? Try setting the pen size
- >(1,0) or (0,1) and see what happens.
-
- If I read Art correctly, he's not concerned about the pixels themselves;
- he's concerned about the region formed by his LineTo()s. And, as IM
- I-181 says, "Only the line endpoints and shape boundaries affect the
- region definition; the pen mode, pattern and size do not affect it."
-
- The fact that the pen hangs down and right is irrelevant to region-
- building. However, the way that the pixels are drawn will tell you how
- the region's boundaries are drawn. Art is concerned, not that the
- pixels are drawn funny, but that his region will be built funny. That's
- a problem with the way LineTo() chooses where to go, and that's not
- something you can cure by messing with the pen. You _might_ be able to
- patch things up, to some degree, by picking your endpoints in an attempt
- to outsmart the algorithm, but that has nothing to do with the pen
- hanging one way or t'other.
-
- Of course, maybe I read Art's question incorrectly...? Art, I would
- advise testing out your region with the region itself, not by looking
- at the pixels drawn by the same set of LineTo()s--the two are not the
- same.
- --
- Jamie McCarthy Internet: k044477@kzoo.edu AppleLink: j.mccarthy
- "Estimated number of DOS viruses in existence today: 1,500
- Number of Macintosh-based viruses: Less than 40
- New DOS viruses discovered in summer '92: More than 100" - ComputerWorld
-