mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 15:14:50 +00:00
Don't ignore UI scale for text (#7510)
# Objective Fixes #7476. UI scale was being incorrectly ignored when a primary window exists. ## Solution Always take into account UI scale, regardless of whether a primary window exists. Tested locally on @forbjok 's minimal repro project https://github.com/forbjok/bevy_ui_repro with this patch, and the issue is fixed on my machine.
This commit is contained in:
parent
e8e61631b7
commit
2e53f3b775
1 changed files with 4 additions and 2 deletions
|
@ -65,10 +65,12 @@ pub fn text_system(
|
|||
)>,
|
||||
) {
|
||||
// TODO: Support window-independent scaling: https://github.com/bevyengine/bevy/issues/5621
|
||||
let scale_factor = windows
|
||||
let window_scale_factor = windows
|
||||
.get_single()
|
||||
.map(|window| window.resolution.scale_factor())
|
||||
.unwrap_or(ui_scale.scale);
|
||||
.unwrap_or(1.);
|
||||
|
||||
let scale_factor = ui_scale.scale * window_scale_factor;
|
||||
|
||||
let inv_scale_factor = 1. / scale_factor;
|
||||
|
||||
|
|
Loading…
Reference in a new issue