verygoodgraphics / vgg_runtime

The official implementation of VGG Specs with cross-platform vector graphics and user interfaces.
https://verygoodgraphics.com
Other
57 stars 4 forks source link

Horizontal auto layout incorrect #386

Open elff1 opened 3 months ago

elff1 commented 3 months ago

Detailed description

The file contains four frames, each with two parts in horizontal auto layout. bug_autolayout.zip

Expected behavior

The left and right parts of all four frames should have equal width. frame3ok

Actual behavior

Only one frame has equal width, while the other three do not. frame3

Steps to reproduce

No response

Additional information

No response

gaimanjing commented 3 months ago

bug.zip is a simplified file. The width attribute of these two nodes in figma is to Fill container. Vgg uses the CSS flex model for layout and uses flex-grow to express this attribute value. The calculation result will add the width of the node itself.

vgg layout spec: https://docs.verygoodgraphics.com/specs/layout/flexbox-item#flexbasis