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

UiScale no longer scales text correctly in Bevy main branch #7476

Closed
forbjok opened this issue Feb 2, 2023 · 4 comments
Closed

UiScale no longer scales text correctly in Bevy main branch #7476

forbjok opened this issue Feb 2, 2023 · 4 comments
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior P-Regression Functionality that used to work but no longer does. Add a test for this!
Milestone

Comments

@forbjok
Copy link
Contributor

forbjok commented Feb 2, 2023

Bevy version

The Bevy main branch, currently commit: 1a18ab3

[Optional] Relevant system information

Rust: 1.67.0
OS: Windows 10 Pro version 10.0.19045 Build 19045

`AdapterInfo { name: "NVIDIA GeForce RTX 2070", vendor: 4318, device: 7943, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "528.24", backend: Vulkan }`

What you did

After updating an existing game project to work with the current Bevy main branch for testing purposes, I noticed that all UI text was extremely tiny and borderline unreadable.

What went wrong

This is because UiScale, which in 0.9.x works correctly and upscales all UI elements, doesn't seem to work on text anymore.

what were you expecting?

UiScale to work the same as before and scale the text up, so that it matches with the rest of the UI and looks correct at all pixel scale values.

what actually happened?

Text always stays the same size (as scale = 1.0), and there also seems to be something very odd going on with positioning, which I'm not entirely sure of the logic of. When pixel scale is increased, all text seems to move to the left, eventually completely off screen.

Additional information

Minimal reproduction repository:
https://github.com/forbjok/bevy_ui_repro
(Press X to increase pixel scale)

Code_nSB5bLfEUl

@forbjok forbjok added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Feb 2, 2023
@alice-i-cecile alice-i-cecile added A-UI Graphical user interfaces, styles, layouts, and widgets P-Regression Functionality that used to work but no longer does. Add a test for this! and removed S-Needs-Triage This issue needs to be labelled labels Feb 2, 2023
@alice-i-cecile alice-i-cecile added this to the 0.10 milestone Feb 2, 2023
@alice-i-cecile
Copy link
Member

Thanks for the minimal reproduction :)

Next step here is probably to bisect to find the offending commit. I've added this to the milestone; I'd really like to avoid shipping this.

@rparrett
Copy link
Contributor

rparrett commented Feb 2, 2023

bisected to #5589

@alice-i-cecile
Copy link
Member

Unsurprising, thanks @rparrett.

@DanielJin21
Copy link
Contributor

This piece of code may be relevant to the issue:

let scale_factor = windows
.get_single()
.map(|window| window.resolution.scale_factor())
.unwrap_or(ui_scale.scale);
Previous to #5589, ui_scale.scale was multiplied with the window's scale if a primary window exists, or used as-is if not. With the current code, ui_scale.scale is ignored if a primary window exists, and text will only scale according to window scale.

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 C-Bug An unexpected or incorrect behavior P-Regression Functionality that used to work but no longer does. Add a test for this!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants