Jump to content
Sign in to follow this  
CaptNeo

Calculation/transform bug when grouping objects in a constraint group

Recommended Posts

Hi,

the constraint group feature is immensely awesome and helpful. However, I've encountered several problems, where the feature does not work as I'd expect. Here I'd like to document one such bug. It starts with a 320x320 constraint group which holds four containers:

2018_03_12_21_14_12_Affinity_Designer.png.4d3e69700a4a8a02ebde015e771879b8.png2018_03_12_21_14_12_Affinity_Designer_Layers.png.4e2262f2b8616a1d12b3f42931cb2ca2.png

  • Yellow and blue are fixed-height headers and footers, that stretch with the parent
  • Green and red stretch to fill the vertical gap between header and footer and their width will always be 25% of the parent

2018_03_12_21_18_53_Greenshot.png.7747cdf0bcf51d1859c2e48fc29c3e7d.png

So far, so good.

Now, I'd like to start adding further elements to the four docked regions. Let's start with centered labels:

2018_03_12_21_32_07_Greenshot.png.959de4e429734dae3a95f8fc31fff9fa.png

The labels are Frame Texts without any constraints.

Now, when I start to group each docked rectangle with its respective label, this happens:

2018_03_12_21_34_50_Greenshot.png.3f56c0b9d89f4d2f3c68570bd2d78065.png

The nested groups do not "wrap" their contents as intended. Actually, the right and bottom groups don't even overlap the geometry of their children at all.

2018_03_12_22_02_17_Greenshot.png.86f9b3ffed4dc3ef02526a4d390c4e33.png

However, the grouped items are still in the right place. Only the newly created "container" groups have the wrong dimensions.

But here's the interesting part: When I scale the parent to match the 1280x720 artboard size, the dimensions of the nested groups almost align with the original 320x320 parent:

2018_03_12_21_44_50_Greenshot.png.15009e85930febbe6cf1a81ad25824c4.png

Long story short: I believe, the dimensions of the nested groups are not computed in the right coordinate system. Somehow, the transformation from "global Artboard space" to "local 1rst-order constraint group space" is performed twice for the newly created "2nd-order" constraint groups.

Regards,
Chris

 

Share this post


Link to post
Share on other sites

Hi CaptNeo

 

We are aware of some issue with constraint not playing nice. However in your example it is also important to take note of layer structure. So you initially create a top level constraint group which works ok as the shapes are all constraining to this master group. next you add text and group it individually with each shape. When grouping this now no longer makes the constraints applied to the shape work in relation to the master group. It now works in relation to this sub group you have created which is what is causing the layer shift. You need to remove the constraints on the shapes before grouping then apply constraints to that entire sub group (not the individual shape inside it) to get it to constraint properly to the master group again.

 

When working with groups within groups it is important to remember that everything resolves bottom up, so the elements in the sub group resolve to the sub group itself, then this sub group resolves to the main top layer group, which then in this case resolves to the artboard

 

Hope that helps add some clarity

 

Thanks


Serif Europe Ltd - Check the latest news at www.affinity.serif.com

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

Please note the Annual Company Closure section in the Terms of Use. These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.