Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Interpretation of constraints inside AutoLayout #680

Open
ivan-015 opened this issue Jul 3, 2022 · 0 comments
Open

Interpretation of constraints inside AutoLayout #680

ivan-015 opened this issue Jul 3, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request refactor

Comments

@ivan-015
Copy link
Collaborator

ivan-015 commented Jul 3, 2022

Description

In the Figma UI, children of AutoLayout Frames have a couple of options when it comes to resizing. Most commonly, those options are FILL and FIXED sizing.

These sizing options, however, do not go into the normal "constraints" property of a Figma object. Rather, they go to LAYOUT_ALIGN and LAYOUT_GROW properties.

Take the following image, for example.

image

Its vertical and horizontal constraints are set to FIXED, which means it shouldn't change sizes as the frame scales up/down. However, in the Figma JSON object, we have the following:

image

Figma exports the constraints as SCALE both vertically and horizontally.

Since parabeac_core exports exactly what Figma tells us, we export the following:

image

This is because Figma told us to scale both images.

Goal

The goal of this task is to define the rules to overwrite the constraints of objects with Layout Grow and Layout Align properties. This should likely be done inside of PBDL, since the rules come from Figma itself, so they should be adjusted so that PBDL exports the correct constraints.

Test

A good golden test for this rule could be the two images that are set to FIX in Figma. The expected output shall be that they are actually fixed in constraints instead of using MediaQuery.

@ivan-015 ivan-015 added enhancement New feature or request refactor labels Jul 3, 2022
@SushiRoll53 SushiRoll53 self-assigned this Jul 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request refactor
Projects
None yet
Development

No branches or pull requests

2 participants