Article View: comp.sys.mac.oop.macapp3
Article #115setting VPoints
From: SDOBBS
Date: Fri, 11 Dec 1992 22:03
Date: Fri, 11 Dec 1992 22:03
40 lines
1783 bytes
1783 bytes
I have seemed to found an interesting feature that I have no explanation
for. I am attempting to create a new VPoint, and give it a value that is
the midpoint of two other points, offset by a certain amount. Nothing
complicated. But when I declare the point using the / operator on the
components of VPoint, the VPoint gets the value (43,43), no matter what I
divide by. Has anyone else seen this?
pascal VPoint* TLink::ComputeLocation(VPoint* from, VPoint* to, VPoint* size)
{
/*this was my first attempt. The later section of code is nothing more
than this
separated out.*/
// VPoint *location= new VPoint(*from[hSel] / 2 + *to[hSel] / 2 -
*size[hSel] / 2,
//
*from[vSel] / 2 + *to[vSel] / 2 - *size[vSel] / 2);
VPoint location = VPoint(*from[hSel] / 2,*from[vSel] / 2);
VPoint temp = VPoint(*to[hSel] / 2,*to[vSel] / 2);
location = location + temp;
VPoint temp2 = VPoint(*size[hSel] / 2,*size[vSel] / 2);
location = location - temp2;
VPoint * loc = new VPoint( location[hSel] , location[vSel]);
return(loc);
}
Steven Dobbs <sdobbs@ai.uwf.edu>
Institute For Human and Machine Cognition
University of West Florida
Pensacola, Florida
Man will occasionally stumble upon the truth, but most of the
time he will pick himself up and continue on.
Technical Details
Message-ID:
<9212112203.AA19321@trivia.coginst.uwf.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!howland.reston.ans.net!wupost!spool.mu.edu!agate!ames!data.nas.nasa.gov!taligent!apple!applelink.apple.comShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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 From: SDOBBS@TRIVIA.COGINST.UWF.EDU Newsgroups: comp.sys.mac.oop.macapp3 Subject: setting VPoints Message-ID: <9212112203.AA19321@trivia.coginst.uwf.edu> Date: 11 Dec 92 22:03:00 GMT Sender: daemon@Apple.COM Organization: AppleLink Gateway Lines: 40