Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Growing UI nodes Fix #8931

Merged
merged 10 commits into from Jul 9, 2023
Merged

Growing UI nodes Fix #8931

merged 10 commits into from Jul 9, 2023

Commits on Jun 21, 2023

  1. bevy_ui::layout

    Taffy's `round_layout` uses a rounding function that rounds away from zero, so x bounds from -100.5 to 99.5 (width 100) will be rounded to -101 to 101 (width 101), gaining a pixel.
    This commit disables Taffy's builtin rounding with a function that round halfs up rather than rounding them towards zero.
    ickshonpe committed Jun 21, 2023
    Configuration menu
    Copy the full SHA
    626ce48 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2023

  1. changes to bevy_ui::layout

    Taffy's builtin rounding is disabled and rounding is now performed by `ui_layout_system`.
    
    Instead of rounding the values of the internal layout tree as Taffy's builtin rounding does, we leave those values unmodified and only the values stored in the components are rounded. This requires that we walk the tree for the uinode geometry update rather than iterating through a query.
    
    Because the component values are regenerated each update, that should mean that UI updates are idempotent now and make the growing node behaviour seen in issue bevyengine#8911 impossible.
    
    Added two helper functions `round_ties_up` and `round_layout_coordinates`.
    ickshonpe committed Jun 22, 2023
    Configuration menu
    Copy the full SHA
    c43ce29 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8209ca7 View commit details
    Browse the repository at this point in the history
  3. cargo fmt

    ickshonpe committed Jun 22, 2023
    Configuration menu
    Copy the full SHA
    bf274a1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    33d675c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1881910 View commit details
    Browse the repository at this point in the history
  6. Removed a needless borrow

    ickshonpe committed Jun 22, 2023
    Configuration menu
    Copy the full SHA
    0c9c285 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    de5653b View commit details
    Browse the repository at this point in the history

Commits on Jun 24, 2023

  1. bevy_ui::layout::round_ties_up

    * Added comments explaining the behaviour of the `round_ties_up` function.
    * Changed the first predicate to use `<=` instead of `<`. This doesn't change the function's behaviour (since `(0.).ceil() == 0.`) but it feels like it makes it a little easier to undertand.
    ickshonpe committed Jun 24, 2023
    Configuration menu
    Copy the full SHA
    33f47a0 View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2023

  1. Configuration menu
    Copy the full SHA
    d1b1aef View commit details
    Browse the repository at this point in the history