Skip to content

BUG: Auto Layout: Horizontal layout cannot preserve child aspect but AspectRatioFitter is not layout aware #13

@awiebe

Description

@awiebe

Suppose you want to a achieve an effect like the dock on MacOS where scaling the tray Rect causes the child icons to scale up while preserving their aspect and laying out horizontally center-middle.

This effect cannot be achieved because the layout can only upscale the width and height it cannot perform an aspect preserving scale.

Attaching an AspectRatioFitter to the child does achieve the desired effect, but on Start() the horizontal layout will shove all of the children to overlap each-other as I guess it believes their width is zero.
Then the layout group forces the scale height of the child to fill itself, and the aspect ratio fitter scales the object to the correct aspect because height controls width, but following this, the horizontal auto-layout does not execute again, so the newly sized rects do not correctly move into place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions