Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Multiple selection does not respect grid anchors (Read 2221 times)
Luca Corsini
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 2
Joined: Sep 30th, 2019
Multiple selection does not respect grid anchors
Sep 30th, 2019 at 1:52pm
Print Post  
Hi. I have been trying the diagrams for quite a bit now and the product works well for all of my needs.

Anyway, I have a problem that I can't fix. When I select a single item and drag it, the item moves inside the grid (I have set setShowGrid to true) correctly, following the anchors, but when I select multiple items (nodes and links), these are moving freely inside the diagram without following the anchors.

Could you suggest a solution to this problem? thank you.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3378
Joined: Oct 19th, 2005
Re: Multiple selection does not respect grid anchors
Reply #1 - Oct 1st, 2019 at 5:10am
Print Post  
Hi,

I wasn't able to reproduce at first, and found AllowMultipleResize being enabled in my test project leads to aligning correctly, so try this as a solution if you don't mind the resizing -

diagram.setAllowMultipleResize(true);

With it disabled, it seems there's some error accumulating and showing after you move same selection a few times? Our developer will check that.

Regards,
Slavcho
Mindfusion
« Last Edit: Oct 1st, 2019 at 6:37am by Slavcho »  
Back to top
 
IP Logged
 
Luca Corsini
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 2
Joined: Sep 30th, 2019
Re: Multiple selection does not respect grid anchors
Reply #2 - Oct 1st, 2019 at 6:19am
Print Post  
Great! With this property it works! I resized and moved a lot of elements multiple times and everything works fine, thank you (maybe i suggest you to add this method in the documentation if there isn't, i couldn't find it).

I have one last thing to settle: If i move an element to the bottom edges of the canvas to resize it, when I reload the diagram everything is fine. By the way, if I do the same thing to the top edges, when I reload the diagram it looks like the diagram moves everything to the top corner and some nodes superimpose others. I will attach two screenshots.
« Last Edit: Oct 1st, 2019 at 9:27am by Luca Corsini »  

Cattura2.PNG (Attachment deleted)
Cattura.PNG (Attachment deleted)
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3378
Joined: Oct 19th, 2005
Re: Multiple selection does not respect grid anchors
Reply #3 - Oct 1st, 2019 at 10:33am
Print Post  
What do you mean by reloading the diagram? Loading from a file, or regenerating it from data and running some layout code?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3378
Joined: Oct 19th, 2005
Re: Multiple selection does not respect grid anchors
Reply #4 - Oct 2nd, 2019 at 4:54am
Print Post  
This should fix alignment when selection resizing disabled -
https://mindfusion.eu/_beta/jsdiag_alignsel.zip

Quote:
when I reload the diagram it looks like the diagram moves everything to the top corner and some nodes superimpose others

What do you mean by reloading the diagram? Loading from a file, or regenerating it from data and running some layout code?


If applying layout code, please post it.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint