Page Index Toggle Pages: 1 [2]  Send TopicPrint
Hot Topic (More than 10 Replies) Drag to change ShapeNode.Bounds (Read 6162 times)
JackPan
Full Member
***
Offline


I Love MindFusion!

Posts: 134
Joined: Apr 9th, 2020
Re: Drag to change ShapeNode.Bounds
Reply #15 - Apr 14th, 2020 at 5:37am
Print Post  
Yes, Lyubo. You are right, I have understood the meaning of this code, but I want to achieve the effect in the screenshot above, prohibiting dragging of the right and bottom edges of overlayNode, whether it is to the left or to the Right direction. Only the left and top edges of overlayNode are allowed to be dragged, and the left or right direction and the diagonal direction are allowed.
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Drag to change ShapeNode.Bounds
Reply #16 - Apr 14th, 2020 at 5:40am
Print Post  
And this is exactly what is happening, unless I'm misinterpreting your explanations.

In your screenshot, I can see that overlayNode.Bounds extend beyond the imageNode right edge. As suggested in a previous post, make sure you're not changing the bounds manually to a bigger value elsewhere - as this will prevent the dragging.
  

right_edge.png ( 11 KB | 94 Downloads )
right_edge.png
Back to top
 
IP Logged
 
JackPan
Full Member
***
Offline


I Love MindFusion!

Posts: 134
Joined: Apr 9th, 2020
Re: Drag to change ShapeNode.Bounds
Reply #17 - Apr 14th, 2020 at 6:13am
Print Post  
Hello,

Thank you, you have not misunderstood. It should be that my question above is not clearly stated.

diagram_NodeModifying currently uses the right value and bottom value of overlayNode to compare with the right value and bottom value of imageNode to control the right edge and bottom edge of overlayNode can not be dragged to the right and bottom direction respectively.
But I also need to prohibit the right edge of overlayNode from being dragged to the left and the bottom edge of overlayNode to be dragged upward. The ultimate goal is to prohibit the right edge of overlayNode from being dragged to the left or right and the bottom edge of overlayNode from being dragged up or down. Only the left edge of overlayNode is allowed to be dragged to the left or right, and the upper edge is allowed to be dragged up or down.

Any assistance would be appreciated.

Cheers,

JackPan
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Drag to change ShapeNode.Bounds
Reply #18 - Apr 14th, 2020 at 6:38am
Print Post  
Ok, now I understand better Smiley

You can either change the bounds check in your code to this:
Code
Select All
// ...
if (e.Node.Bounds.Right != imageNode.Bounds.Right ||
			e.Node.Bounds.Bottom != imageNode.Bounds.Bottom)
// ... 



or disable the bottom and right handles altogether, by toggling them off like this:
Code
Select All
overlayNode.EnabledHandles ^= AdjustmentHandles.Move | AdjustmentHandles.BottomHandles | AdjustmentHandles.RightHandles; 



Regards,
Lyubo
MindFusion
  
Back to top
 
IP Logged
 
JackPan
Full Member
***
Offline


I Love MindFusion!

Posts: 134
Joined: Apr 9th, 2020
Re: Drag to change ShapeNode.Bounds
Reply #19 - Apr 14th, 2020 at 6:59am
Print Post  
Thanks a lot to you, 
Lyubo.

Smiley Smiley Smiley Smiley Smiley Smiley Smiley

I've done it.

Cheers,

JackPan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint