Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How do I just click the line to select node? (Read 1388 times)
chowy
Junior Member
**
Offline


I Love MindFusion!

Posts: 72
Joined: May 8th, 2017
How do I just click the line to select node?
Jul 3rd, 2017 at 2:33am
Print Post  
I inherited from the shapenode, I draw a rectangular node, its background color is transparent, I want to achieve when the user click inside the rectangle is not selected, when the user click on the rectangular border to be selected? But when the node background color is filled , Click inside can be selected? Mindfusion can be set directly?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: How do I just click the line to select node?
Reply #1 - Jul 3rd, 2017 at 8:29am
Print Post  
Try this -

Code
Select All
public override bool ContainsPoint(Point diagramPoint)
{
	var geometry = new RectangleGeometry(Bounds);
	var solid = Brush as SolidColorBrush;
	if (solid != null && solid.Color.A == 0)
		return geometry.StrokeContains(new Pen(Brushes.Black, 4), diagramPoint);
	return base.ContainsPoint(diagramPoint);
} 



Regards,
Slavcho
  
Back to top
 
IP Logged
 
chowy
Junior Member
**
Offline


I Love MindFusion!

Posts: 72
Joined: May 8th, 2017
Re: How do I just click the line to select node?
Reply #2 - Jul 3rd, 2017 at 9:34am
Print Post  
Slavcho wrote on Jul 3rd, 2017 at 8:29am:
Try this -

Code
Select All
public override bool ContainsPoint(Point diagramPoint)
{
	var geometry = new RectangleGeometry(Bounds);
	var solid = Brush as SolidColorBrush;
	if (solid != null && solid.Color.A == 0)
		return geometry.StrokeContains(new Pen(Brushes.Black, 4), diagramPoint);
	return base.ContainsPoint(diagramPoint);
} 



Regards,
Slavcho


Ok!Thanks! Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint