🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.mac.oop.macapp3
1 messages
1 total messages Started by SDOBBS Fri, 11 Dec 1992 22:03
setting VPoints
#115
Author: SDOBBS
Date: Fri, 11 Dec 1992 22:03
40 lines
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.
 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads