Page Index Toggle Pages: 1 [2]  Send TopicPrint
Hot Topic (More than 10 Replies) Center handler hittest & TouchThreshold (Read 8706 times)
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Center handler hittest & TouchThreshold
Reply #15 - Feb 5th, 2018 at 11:36am
Print Post  
I guess it might still be loading a design.dll from the main installation, it's pointed by a registry key added by the installer. So maybe check if you are overwriting the design.dll assemblies located under clr4/design folder. We'll try to release this with a small update in a few days anyway.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
Kyle Chen
Full Member
***
Offline


I Love MindFusion!

Posts: 104
Joined: Nov 29th, 2012
Re: Center handler hittest & TouchThreshold
Reply #16 - Feb 6th, 2018 at 2:19pm
Print Post  
OK. Great. I can wait for that release. Thank you Slavcho!
  
Back to top
 
IP Logged
 
Kyle Chen
Full Member
***
Offline


I Love MindFusion!

Posts: 104
Joined: Nov 29th, 2012
Re: Center handler hittest & TouchThreshold
Reply #17 - May 22nd, 2018 at 2:16pm
Print Post  
Hello Slavcho,

Sorry I have to re-open this post again.

After running the beta version for a while, looks like we have to disable the center handles(to link nodes) otherwise it's hard to move the node, especially when the nodes is a small one. I set the TouchThreshold to 4.

Is there easy way to do this?

Thanks!

Kyle
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Center handler hittest & TouchThreshold
Reply #18 - May 25th, 2018 at 9:59am
Print Post  
Hi Kyle,

Set HandlesStyle to Custom and handle Draw/HitTest events -

Code
Select All
void OnDrawAdjustmentHandles(
	object sender, MindFusion.Diagramming.DrawItemEventArgs e)
{
	var node = (DiagramNode)e.Item;
	var style = node == diagram.ActiveItem ?
		diagram.ActiveItemHandlesStyle :
		diagram.SelectedItemHandlesStyle;

	InternalUtils.DrawSelHandles(
		e.Graphics,
		style,
		diagram.DisabledHandlesStyle,
		node.Bounds,
		node.RotationAngle,
		node.EnabledHandles,
		true,
		HandlesStyle.SquareHandles2,
		diagram.AdjustmentHandlesSize,
		new RenderOptions());
}

void OnHitTestAdjustmentHandles(object sender, HitTestEventArgs e)
{
	var node = (DiagramNode)e.Item;
	node.HandlesStyle = HandlesStyle.EasyMove;

	AdjustmentHandle handle = node.HitTestHandle(e.MousePosition);
	if (handle == null && node.ContainsPoint(e.MousePosition))
		handle = new NodeAdjustmentHandle(NodeHandleType.Move);
	e.HitResult = handle;
	node.HandlesStyle = HandlesStyle.Custom;
} 



Regards,
Slavcho
  
Back to top
 
IP Logged
 
Kyle Chen
Full Member
***
Offline


I Love MindFusion!

Posts: 104
Joined: Nov 29th, 2012
Re: Center handler hittest & TouchThreshold
Reply #19 - May 30th, 2018 at 6:55pm
Print Post  
Hello Slavcho,

I changed the HandlesStyle to Squarehandles2 directly and it has the similar effect as the code you provided. We also can resize a node from the whole edge area, not only the small handles. It is much better.

Thank you very much!

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