Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Group - attach without resize (Read 2037 times)
Konstantin Vasilev
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Aug 23rd, 2022
Group - attach without resize
Aug 23rd, 2022 at 5:10am
Print Post  
Hello.
I would like to know how to attach an element to a group so that this element's size won't change if the master item gets resized?
Let's say I have a center point in my element and I want it to stay in the same position (relatively) regardless of the master size.

It looks like from all "Attach" methods none really fits this need - AttachToCorner and AttachToSideMiddle force my element to be in certain position I can't modify, AttachToEdges and AttachProportional will resize my element if the master node is resized.

It also seems that I can't use custom logic for the "attach" method since none of the methods suits my needs and AttachedNodes collection is a readonly collection.

Please advise.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Group - attach without resize
Reply #1 - Aug 23rd, 2022 at 9:54am
Print Post  
Hi,

AttachToCorner and AttachToSideMiddle should work, and possibly AttachToEdges if you specify just one horizontal and one vertical edge. They do not force attached nodes to the specified point, but record the initial offset from it and should preserve it when master node is moved or resized.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Konstantin Vasilev
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Aug 23rd, 2022
Re: Group - attach without resize
Reply #2 - Aug 25th, 2022 at 10:52pm
Print Post  
Thank you for the reply. Unfortunately, both AttachToSideMiddle and AttachToCorner didn't work for me. I also tried to use the AttachToEdges method and supply it with the closest edges to my elements, but had no luck with it - my elements just didn't stick to their original relative position.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Group - attach without resize
Reply #3 - Aug 26th, 2022 at 6:55am
Print Post  
Please post your code. E.g. the icons in this demo page are ShapeNodes attached to table's bottom left corner, preserving relative positions and not resizing -



  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Group - attach without resize
Reply #4 - Aug 26th, 2022 at 1:38pm
Print Post  
Or did you mean you do not need preserving absolute offsets, but specify positions as fractions of width / height as in 'proportional' attachment type, just without resizing?
  
Back to top
 
IP Logged
 
Konstantin Vasilev
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Aug 23rd, 2022
Re: Group - attach without resize
Reply #5 - Aug 29th, 2022 at 4:55pm
Print Post  
Yes, I need to preserve the relative position of attachment in percent of master item's height/width, without resizing the attached item itself.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Group - attach without resize
Reply #6 - Aug 30th, 2022 at 4:51pm
Print Post  
Try new overloads here -
https://mindfusion.eu/_beta/wpfdiag383.zip

Code
Select All
DiagramNode.AttachTo(node, percentX, percentY);
Group.AttachToFractionalPosition(node, percentX, percentY); 



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Konstantin Vasilev
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Aug 23rd, 2022
Re: Group - attach without resize
Reply #7 - Sep 5th, 2022 at 1:45pm
Print Post  
Seems to be working fine.
Thank you!

Do you have an ETA of when the 3.8.3 is going to be released?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Group - attach without resize
Reply #8 - Sep 6th, 2022 at 8:34am
Print Post  
Hi,

We plan it for mid-November.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Konstantin Vasilev
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Aug 23rd, 2022
Re: Group - attach without resize
Reply #9 - Sep 7th, 2022 at 2:11pm
Print Post  
Is there any way to add this method before November? Are there any alternative ways to achieve this?
I can write any custom code if necessary.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Group - attach without resize
Reply #10 - Sep 8th, 2022 at 6:10am
Print Post  
You already have it in assemblies above, just use them? That's only new thing there since 3.8.2 release from month ago, so should be stable enough.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Konstantin Vasilev
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Aug 23rd, 2022
Re: Group - attach without resize
Reply #11 - Sep 8th, 2022 at 11:41pm
Print Post  
Ok, sounds good. Thanks for your help!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint