Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic HitTestAdjustmentHandles (Read 1203 times)
Kyle Chen
Full Member
***
Offline


I Love MindFusion!

Posts: 104
Joined: Nov 29th, 2012
HitTestAdjustmentHandles
May 29th, 2013 at 6:58pm
Print Post  
Hi Stoyan,

Is there any easy way for me to decide and enable the Resize handles since I was setting it to Move always before. Now Some items need to be resizable. (I'm using "Custom" HandleStyle)

void diagram_HitTestAdjustmentHandles(object sender, HitTestEventArgs e)
{
    if (e.Item != null && e.Item.ContainsPoint(e.MousePosition))
    {
         e.HitResult = 8;
    }
}

Thanks!

Kyle
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: HitTestAdjustmentHandles
Reply #1 - May 29th, 2013 at 7:09pm
Print Post  
Hi,

You could assign one of the standard styles to nodes that can be resized. If you prefer using an event handler for all nodes, you could still reuse the hit-testing code for some of the standard handle styles as shown here:
http://mindfusion.eu/Forum/YaBB.pl?num=1326281190/3#3

You can also compare the point coordinates with node's border and corner coordinates and set HitResult accordingly.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Kyle Chen
Full Member
***
Offline


I Love MindFusion!

Posts: 104
Joined: Nov 29th, 2012
Re: HitTestAdjustmentHandles
Reply #2 - May 29th, 2013 at 7:24pm
Print Post  
Yes, the link you provided is what I want. Thank you for help!

Kyle
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint