home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 20807 < prev    next >
Encoding:
Text File  |  1993-01-06  |  2.8 KB  |  58 lines

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