Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Offset in ClientToDoc (Read 2347 times)
oOAnriOo
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Oct 12th, 2009
Offset in ClientToDoc
Nov 18th, 2009 at 10:28am
Print Post  
I'm trying to determine wether an object is dragged over a diagramnode. For that I use the code below.

Problem is; using the code below, the background changes to yellow a bit BEFORE I hit the object and back to white a bit BEFORE i exit the object.
It seems to me that the ClientToDoc is off by a small amount..
If I set an anchorpoint in each corner of my node, they show as expected, but still the drag-position doesn't quite hit the spot.

What am I missing?
Quote:
protected override void OnDragOver(DragEventArgs drgevent)
{
Point pt = this.PointToClient(Cursor.Position);//new Point(drgevent.X, drgevent.Y));
PointF lDragPosition = this.ClientToDoc(new Point(pt.X,pt.Y));
foreach (MindFusion.Diagramming.DiagramNode iNode in this.Diagram.Nodes)
{
if (iNode.Bounds.Contains(lDragPosition))
iNode.Brush = new MindFusion.Drawing.SolidBrush(Color.Yellow);
else
iNode.Brush = new MindFusion.Drawing.SolidBrush(Color.White);
}
base.OnDragOver(drgevent);
}
  
Back to top
 
IP Logged
 
oOAnriOo
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 19
Joined: Oct 12th, 2009
Re: Offset in ClientToDoc
Reply #1 - Nov 18th, 2009 at 10:42am
Print Post  
Well.
This turned out not to be a problem with the MindFusion components.

The hotspot on my pointer is off when it enters my application..   I think its a Windows 7/Aero bug simce it works fine on other computers.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint