Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions crates/bevy_sprite/src/text2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(()) => {}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion crates/bevy_text/src/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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<RunGeometry>,
/// 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)>,
Expand Down
2 changes: 0 additions & 2 deletions crates/bevy_ui/src/widget/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
Loading