Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Method to access anchor position relative to doc (Read 1682 times)
p.hannah
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 38
Joined: Feb 1st, 2006
Method to access anchor position relative to doc
Aug 1st, 2006 at 5:20am
Print Post  
I'm looking for a method under anchor that will return the actual doc position of the anchor.

Essentially this is the exact same code chunk used by draw(...) in AnchorPoint.

I've changed anchorpoint to include the code:
    public PointF AnchorToDoc(RectangleF nodeRect, float angle)
    {
     float cX = nodeRect.X + nodeRect.Width * x / 100;
     float cY = nodeRect.Y + nodeRect.Height * y / 100;

     PointF point = new PointF(cX, cY);

     if (angle != 0)
     {
       point = Utilities.rotatePointAt(point,
         Utilities.getCenter(nodeRect), angle);
       cX = point.X;
       cY = point.Y;
     }

     return point;
    }
   
but you can probably find a better place for it...
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint