Skip to content

Support aspect-ratio for Leaf nodes #313

@adjabaev

Description

@adjabaev

What problem does this solve or what need does it fill?

The css aspect ratio property isn't supposed for leaf nodes.

What solution would you like?

The support for that property out of the box
Also it would be nice to test if this property works well for grid/ flex nodes (I didn't find any test testing the property)

What alternative(s) have you considered?

  • Entering cross axis size manually
  • Implementing this by myself, unfortunately the knowDimensions.width that passes into Leaf's compute function is equal to 100f32 (more context in the gist below) which is the parent's width (does this make sense?). Getting cross axis would be easy if that parameter was equal to Option::None. Also this is the first rust project i'm working with, I don't feel very confident in what I am doing yet.

Additional context

I've done some researches to ensure this wasn't supported
Here is an adaptation of the test script (js) to take aspectRatio into account aswell as a simple test that shows the issue (rs & html files)
https://gist.github.com/adjabaev/4dfd194ddee6becab49c9dbdbd191baa

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions