cdmvision / unity-figma-importer

Unity Figma Importer turns your Figma design into Unity UI elements and can bind codes with layout files to create Unity apps with ease.
MIT License
89 stars 6 forks source link

Auto layout - auto spacing is not imported correctly #66

Open ibrahimpenekli opened 1 year ago

ibrahimpenekli commented 1 year ago

In Unity, Spacing expected to be 0 when auto spacing is enabled in Figma:

WhatsApp Image 2023-07-26 at 14 40 08

WhatsApp Image 2023-07-26 at 14 40 32

gunseliozkan commented 1 year ago

Isn't spacing should be flexible according to number of layout elements rather than 0?

gunseliozkan commented 1 year ago

Like:

gunseliozkan commented 1 year ago

Nvm, got it. Child force expand should be on in parent in order to mimic this behavior. Spacing stays 0 this way.

ibrahimpenekli commented 1 year ago

Nvm, got it. Child force expand should be on in parent in order to mimic this behavior. Spacing stays 0 this way.

It was already in parent in the first example above.

ibrahimpenekli commented 1 year ago

Isn't spacing should be flexible according to number of layout elements rather than 0?

No, layout group should calculate it on-the-fly.

gunseliozkan commented 1 year ago

Child force expand adds extra space to the trailing part of layout ->

Ekran Resmi 2023-07-31 11 54 32
ibrahimpenekli commented 10 months ago

We could calculate "Spacing" of the layout group component on-the-fly in another component.