Skip to content

Commit 2e53f3b

Browse files
committed
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.
1 parent e8e6163 commit 2e53f3b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/bevy_ui/src/widget/text.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@ pub fn text_system(
6565
)>,
6666
) {
6767
// TODO: Support window-independent scaling: https://github.com/bevyengine/bevy/issues/5621
68-
let scale_factor = windows
68+
let window_scale_factor = windows
6969
.get_single()
7070
.map(|window| window.resolution.scale_factor())
71-
.unwrap_or(ui_scale.scale);
71+
.unwrap_or(1.);
72+
73+
let scale_factor = ui_scale.scale * window_scale_factor;
7274

7375
let inv_scale_factor = 1. / scale_factor;
7476

0 commit comments

Comments
 (0)