home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / mac / oop / macapp3 / 172 < prev    next >
Encoding:
Internet Message Format  |  1992-12-11  |  1.7 KB

  1. Path: sparky!uunet!europa.asd.contel.com!howland.reston.ans.net!wupost!spool.mu.edu!agate!ames!data.nas.nasa.gov!taligent!apple!applelink.apple.com
  2. From: SDOBBS@TRIVIA.COGINST.UWF.EDU
  3. Newsgroups: comp.sys.mac.oop.macapp3
  4. Subject: setting VPoints
  5. Message-ID: <9212112203.AA19321@trivia.coginst.uwf.edu>
  6. Date: 11 Dec 92 22:03:00 GMT
  7. Sender: daemon@Apple.COM
  8. Organization: AppleLink Gateway
  9. Lines: 40
  10.  
  11. I have seemed to found an interesting feature that I have no explanation
  12. for.  I am attempting to create a new VPoint, and give it a value that is
  13. the midpoint of two other points, offset by a certain amount.  Nothing
  14. complicated.  But when I declare the point using the / operator on the
  15. components of VPoint, the VPoint gets the value (43,43), no matter what I
  16. divide by.  Has anyone else seen this?
  17.  
  18. pascal VPoint* TLink::ComputeLocation(VPoint* from, VPoint* to, VPoint* size)
  19. {
  20.  
  21. /*this was my first attempt.  The later section of code is nothing  more
  22. than this
  23. separated out.*/
  24. //      VPoint *location= new VPoint(*from[hSel] / 2 + *to[hSel] / 2 -
  25. *size[hSel] / 2,
  26. //
  27. *from[vSel] / 2 + *to[vSel] / 2 - *size[vSel] / 2);
  28.  
  29.  
  30.        VPoint location =  VPoint(*from[hSel] / 2,*from[vSel] / 2);
  31.  
  32.         VPoint temp =   VPoint(*to[hSel] / 2,*to[vSel] / 2);
  33.         location = location + temp;
  34.         VPoint temp2 =  VPoint(*size[hSel] / 2,*size[vSel] / 2);
  35.         location = location - temp2;
  36.  
  37.         VPoint * loc = new VPoint( location[hSel] , location[vSel]);
  38.  
  39.         return(loc);
  40.  
  41. }
  42.  
  43. Steven Dobbs <sdobbs@ai.uwf.edu>
  44. Institute For Human and Machine Cognition
  45. University of West Florida
  46. Pensacola, Florida
  47.  
  48. Man will occasionally stumble upon the truth, but most of the
  49. time he will pick himself up and continue on.
  50.  
  51.