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

UI does not update in sync with window resizes #14255

Closed
UkoeHB opened this issue Jul 9, 2024 · 0 comments · Fixed by #14609
Closed

UI does not update in sync with window resizes #14255

UkoeHB opened this issue Jul 9, 2024 · 0 comments · Fixed by #14609
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior
Milestone

Comments

@UkoeHB
Copy link
Contributor

UkoeHB commented Jul 9, 2024

Bevy version

v0.14.0

[Optional] Relevant system information

MacOS v12.5.1

What you did

  • Ran cargo run --example ui.
  • Resized the window.

What went wrong

The UI jitters because it reacts to window resizes one frame late.

Comments

I tested this on v0.13.0 and it was smooth, so this is a regression.

See #14277 for a related issue.

@UkoeHB UkoeHB added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jul 9, 2024
@alice-i-cecile alice-i-cecile added A-Windowing Platform-agnostic interface layer to run your app in A-UI Graphical user interfaces, styles, layouts, and widgets and removed S-Needs-Triage This issue needs to be labelled labels Jul 9, 2024
@alice-i-cecile alice-i-cecile added this to the 0.14.1 milestone Jul 9, 2024
@alice-i-cecile alice-i-cecile modified the milestones: 0.14.1, 0.14.2 Aug 2, 2024
github-merge-queue bot pushed a commit that referenced this issue Aug 4, 2024
)

# Objective

Fixes #14277.

May also fix #14255, needs
verification.

## Solution

Explicitly order `CameraUpdateSystem` before `UiSystem::Prepare`, so
that when the window resizes, `camera_system` will update the `Camera`'s
viewport size before `ui_layout_system` also reacts to the window resize
and tries to read the new `Camera` viewport size to set UI node sizes
accordingly.

## Testing

I tested that explicitly ordering `CameraUpdateSystem` _after_ triggers
the buggy behavior, and explicitly ordering it _before_ does not trigger
the buggy behavior or crash the app (which also demonstrates that the
system sets are ambiguous).

---

## Migration Guide

`CameraUpdateSystem` is now explicitly ordered before
`UiSystem::Prepare` instead of being ambiguous with it.
mockersf pushed a commit that referenced this issue Sep 5, 2024
)

Fixes #14277.

May also fix #14255, needs
verification.

Explicitly order `CameraUpdateSystem` before `UiSystem::Prepare`, so
that when the window resizes, `camera_system` will update the `Camera`'s
viewport size before `ui_layout_system` also reacts to the window resize
and tries to read the new `Camera` viewport size to set UI node sizes
accordingly.

I tested that explicitly ordering `CameraUpdateSystem` _after_ triggers
the buggy behavior, and explicitly ordering it _before_ does not trigger
the buggy behavior or crash the app (which also demonstrates that the
system sets are ambiguous).

---

`CameraUpdateSystem` is now explicitly ordered before
`UiSystem::Prepare` instead of being ambiguous with it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants