Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Diagram scrolls when new node is created. (Read 1428 times)
priyanka
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Sep 2nd, 2009
Diagram scrolls when new node is created.
Dec 11th, 2009 at 3:10pm
Print Post  
Hi,

Please refer mail subjected:"Diagram Scrolls on creating new node"

Steps to Reproduce the issue:
1. Start Application
2. Click Draw button
3. The mouse changes to CrossHair.
4. Draw a rectangle on the diagram, to specify the location to draw the new node.
5. Release the mouse button.
6. The new node will get crated but the diagram moves to other location.
7. Click the Fit button.
8 Node titles "AAA" is the new node created.

Issue: The diagram scrolls to a different location after creating the node.

Expected result: The diagram should not scroll. It should be on the location where it was before drawing the node.

Please provide some inputs.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram scrolls when new node is created.
Reply #1 - Dec 11th, 2009 at 4:53pm
Print Post  
This happens because when Nodes.Add is called, the node is at its default position at 0,0 and the auto-resize code resizes the diagram to include this point. Just set node.Bounds to the expected position before adding the node to the diagram:

mainNode.Bounds = rect;
diagram.Nodes.Add(mainNode);

Stoyan
  
Back to top
 
IP Logged
 
priyanka
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 56
Joined: Sep 2nd, 2009
Re: Diagram scrolls when new node is created.
Reply #2 - Dec 14th, 2009 at 5:05am
Print Post  
Thanks Stoyo...!! Cheesy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint