Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to get the DecorationHitTesting to work? (Read 2414 times)
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
How to get the DecorationHitTesting to work?
Jul 28th, 2014 at 7:23pm
Print Post  
Hi,

I have a shape with an outline and some decorations, that I'd like to be part of hit testing, so that I can create links by clicking on them. If I understand correctly, setting the DecorationHitTesting property to "true" on the shape should do what I need, but for some reason it doesn't. Thoughts?

By the way, the shape nodes are part of containers, although that shouldn't be an issue I think (I didn't see a difference when dragging them outside of the containers).

Thanks,
-Mihai
  
Back to top
 
IP Logged
 
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
Re: How to get the DecorationHitTesting to work?
Reply #1 - Jul 28th, 2014 at 7:26pm
Print Post  
Also, what is the meaning of "near" in the docs: "If this property is enabled, users are able to select shape nodes of such shape by clicking near a decoration line or curve, even if it lies outside the shape outlines."? Is it customizable?

Thanks again,
-Mihai
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to get the DecorationHitTesting to work?
Reply #2 - Jul 29th, 2014 at 7:34am
Print Post  
This seems to happen if you use a Shape with no string identifier defined, which makes it private for the node and the Shape property setter clones it. Apparently the Shape.Clone code does not copy DecorationHitTesting value at this time, so you could set it after assigning to node.Shape as a work-around:

Code
Select All
shape.Shape = myShape;
shape.Shape.DecorationHitTesting = true; 



"near" is fixed 5 millimeters, we could add a property for next release if you need it.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
Re: How to get the DecorationHitTesting to work?
Reply #3 - Jul 29th, 2014 at 10:29am
Print Post  
Hi Stoyan,

Quote:
Shape.Clone code does not copy DecorationHitTesting value at this time

Will this be fixed in the next release?

Quote:
so you could set it after assigning to node.Shape as a work-around

Thanks, it works!

Quote:
"near" is fixed 5 millimeters, we could add a property for next release if you need it.

Now that I see it in action, I think 5 mm is a good choice.

Thanks,
-Mihai
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to get the DecorationHitTesting to work?
Reply #4 - Jul 29th, 2014 at 11:09am
Print Post  
Sure, it's now fixed in this build:
https://mindfusion.eu/_beta/wpfdiag32.zip

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
Re: How to get the DecorationHitTesting to work?
Reply #5 - Aug 4th, 2014 at 8:43am
Print Post  
Thanks Stoyan!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint