From 116c2b02fe8a7589d1777af7dabd84dc756b5b0d Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Thu, 12 Dec 2024 19:50:11 +0000 Subject: [PATCH] =?UTF-8?q?Remove=20the=20coordinate=20rounding=20from=20`?= =?UTF-8?q?extract=5Ftext=5Fsections`.=20The=20coor=E2=80=A6=20(#16616)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Objective Remove the coordinate rounding from `extract_text_sections`. The coordinates are already rounded during the layout update. --- crates/bevy_ui/src/render/mod.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/crates/bevy_ui/src/render/mod.rs b/crates/bevy_ui/src/render/mod.rs index 8dd0e17411..d299267f15 100644 --- a/crates/bevy_ui/src/render/mod.rs +++ b/crates/bevy_ui/src/render/mod.rs @@ -663,14 +663,8 @@ pub fn extract_text_sections( continue; }; - // Align the text to the nearest pixel: - // * Translate by minus the text node's half-size - // (The transform translates to the center of the node but the text coordinates are relative to the node's top left corner) - // * Round the position to the nearest physical pixel - - let mut transform = global_transform.affine() + let transform = global_transform.affine() * bevy_math::Affine3A::from_translation((-0.5 * uinode.size()).extend(0.)); - transform.translation = transform.translation.round(); let mut color = LinearRgba::WHITE; let mut current_span = usize::MAX;