Skip to content

Commit 116c2b0

Browse files
authored
Remove the coordinate rounding from extract_text_sections. The coor… (#16616)
# Objective Remove the coordinate rounding from `extract_text_sections`. The coordinates are already rounded during the layout update.
1 parent d132239 commit 116c2b0

File tree

1 file changed

+1
-7
lines changed
  • crates/bevy_ui/src/render

1 file changed

+1
-7
lines changed

crates/bevy_ui/src/render/mod.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -663,14 +663,8 @@ pub fn extract_text_sections(
663663
continue;
664664
};
665665

666-
// Align the text to the nearest pixel:
667-
// * Translate by minus the text node's half-size
668-
// (The transform translates to the center of the node but the text coordinates are relative to the node's top left corner)
669-
// * Round the position to the nearest physical pixel
670-
671-
let mut transform = global_transform.affine()
666+
let transform = global_transform.affine()
672667
* bevy_math::Affine3A::from_translation((-0.5 * uinode.size()).extend(0.));
673-
transform.translation = transform.translation.round();
674668

675669
let mut color = LinearRgba::WHITE;
676670
let mut current_span = usize::MAX;

0 commit comments

Comments
 (0)