diff --git a/crates/bevy_sprite/src/text2d.rs b/crates/bevy_sprite/src/text2d.rs index 8a93342b03c9e..dff6551b9b9fd 100644 --- a/crates/bevy_sprite/src/text2d.rs +++ b/crates/bevy_sprite/src/text2d.rs @@ -331,10 +331,7 @@ pub fn update_text2d_layout( ) => { panic!("Fatal error when processing text: {e}."); } - Ok(()) => { - text_layout_info.scale_factor = scale_factor; - text_layout_info.size *= scale_factor.recip(); - } + Ok(()) => {} } } } diff --git a/crates/bevy_text/src/pipeline.rs b/crates/bevy_text/src/pipeline.rs index 515c1d75042d8..9b2ea8ea4e1f5 100644 --- a/crates/bevy_text/src/pipeline.rs +++ b/crates/bevy_text/src/pipeline.rs @@ -318,6 +318,7 @@ impl TextPipeline { let layout = &mut computed.layout; layout_with_bounds(layout, bounds, justify); + layout_info.scale_factor = layout.scale(); for (line_index, line) in layout.lines().enumerate() { for item in line.items() { @@ -471,7 +472,7 @@ pub struct TextLayoutInfo { /// /// The coordinates are unscaled and relative to the top left corner of the text layout. pub run_geometry: Vec, - /// The glyphs resulting size + /// The size of the text layout in physical pixels pub size: Vec2, /// Cursor visibility, size and position for editing pub cursor: Option<(bool, Rect)>, diff --git a/crates/bevy_ui/src/widget/text.rs b/crates/bevy_ui/src/widget/text.rs index fe8eabee77dcf..9a6e7e9c6b7a5 100644 --- a/crates/bevy_ui/src/widget/text.rs +++ b/crates/bevy_ui/src/widget/text.rs @@ -400,8 +400,6 @@ pub fn text_system( panic!("Fatal error when processing text: {e}."); } Ok(()) => { - text_layout_info.scale_factor = node.inverse_scale_factor().recip(); - text_layout_info.size *= node.inverse_scale_factor(); text_flags.needs_recompute = false; } }