Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Restrict zooming on only one ShapeNode (Read 2461 times)
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Restrict zooming on only one ShapeNode
May 12th, 2010 at 3:43am
Print Post  
Hi,

In our diagram, we are having several of ShapeNodes. We are performing zoom-in/zoom-out on MouseWheel.

1. For a particular node, we want to restrict zooming. We want that particular node will always have the same appearance to the user, it size should not increase or decrease with respect to zoom factor. How we can achieve this?

2. For that node only, we want to set a different cursor. When mouse moves on that node, cursor should get change to some other cursor and on leave from that node it should reset automatically. Is there any property for this?

Please let us know your suggestion.

Regards,
Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Restrict zooming on only one ShapeNode
Reply #1 - May 12th, 2010 at 6:17am
Print Post  
Hi,

1. Should it scroll with the diagram?

2. Set the OverrideCursor property when the mouse is over the node. E.g. handle the node's MouseEnter and MouseLeave events to do that, or in a Diagram.MouseMove handler check whether GetNodeAt returns that node and respectively set or clear the cursor.

Stoyan
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Restrict zooming on only one ShapeNode
Reply #2 - May 12th, 2010 at 8:03am
Print Post  
1. yes it should scroll with the diagram.
2. Thanks, we have thought about node's mouse cursor property if any.


Regards,
Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Restrict zooming on only one ShapeNode
Reply #3 - May 12th, 2010 at 10:22am
Print Post  
Call this from the ZoomFactorChanged handler:

Code
Select All
var transform = node.RenderTransform as MatrixTransform;
if (transform != null)
{
	double scale = 100.0 / diagram.ZoomFactor;

	Matrix m = transform.Matrix;
	m.M11 = m.M22 = scale;
	transform.Matrix = m;
} 



It will work only for visualization. If you need to let the user select and resize the node, you must change Bounds instead, since the Bounds value is used for adjustment handles hit-testing.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Restrict zooming on only one ShapeNode
Reply #4 - May 14th, 2010 at 3:42am
Print Post  
Hi Stoyan,

1. I want to fix node's position; it should always have the TopLeft position of the diagram. If we perform zoom-in and zoom-out over the diagram, in this case also its position should not change i.e. it should have inside the diagram but behave like a separate window. How can we do this?

2. We want virtualization support. If user perform scrolling, node should move always to have it TopLeft position of the diagram. Is it possible to apply virtualization for a single node?

3. As per your suggestion we have used ZoomFactorChanged handler to handle its size constant but while we are doing zoom-in and zoom-out, controls inside the DiagramNodeAdapter is flickering. Also position of controls is getting up and down while we are changing zoom factor. How to solve this?

Please let us know your suggestions.

Regards,
Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Restrict zooming on only one ShapeNode
Reply #5 - May 17th, 2010 at 10:36am
Print Post  
If it also should not scroll, then is there any reason you want to keep this node inside the diagram, such as creating links to it? If not, better display it as a separate control placed over the diagram.

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