Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic multi node drag position (Read 2077 times)
ulthien
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 91
Location: Munich
Joined: Nov 29th, 2011
multi node drag position
Oct 8th, 2012 at 4:02pm
Print Post  
hello,

when the user drags around e.g. several selected nodes together,

how to get the position of the top left corner? (in order to place e.g. a container node there)

i tried with:

Code
Select All
                            var dragRect = new Rect();
                            foreach (DiagramNode node in Selection.Items)
                            {
                                dragRect.Union(node.Bounds);
                            }
                            var mp = new Point(dragRect.Left, dragRect.Top); 



but this (i think) does not reflect the position of right now visually dragged nodes around...

cheers
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: multi node drag position
Reply #1 - Oct 9th, 2012 at 6:23am
Print Post  
Hi,

Try with diagram.Selection.Bounds. Or using your code, initialize dragRect with the Bounds of the first selected node instead of a new Rect, or otherwise the union might always include the (0,0) point.

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


I love YaBB 1G - SP1!

Posts: 91
Location: Munich
Joined: Nov 29th, 2011
Re: multi node drag position
Reply #2 - Oct 9th, 2012 at 8:32am
Print Post  
thx, this is an excellent tip - it works Smiley

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