Skip to content
Merged
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
2 changes: 1 addition & 1 deletion crates/bevy_sprite/src/text2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ pub fn update_text2d_layout(
block.linebreak,
block.justify,
text_bounds,
scale_factor as f64,
scale_factor,
&mut computed,
&mut font_system,
*hinting,
Expand Down
12 changes: 6 additions & 6 deletions crates/bevy_text/src/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl TextPipeline {
linebreak: LineBreak,
justify: Justify,
bounds: TextBounds,
scale_factor: f64,
scale_factor: f32,
computed: &mut ComputedTextBlock,
font_system: &mut CosmicFontSystem,
hinting: FontHinting,
Expand Down Expand Up @@ -218,7 +218,7 @@ impl TextPipeline {
}

const WARN_FONT_SIZE: f32 = 1000.0;
if text_font.font_size * scale_factor as f32 > WARN_FONT_SIZE {
if text_font.font_size * scale_factor > WARN_FONT_SIZE {
warn_once!(
"Text span {entity} has an excessively large font size ({} with scale factor {}). \
Extremely large font sizes will cause performance issues with font atlas \
Expand Down Expand Up @@ -285,7 +285,7 @@ impl TextPipeline {
entity: Entity,
fonts: &Assets<Font>,
text_spans: impl Iterator<Item = (Entity, usize, &'a str, &'a TextFont, Color, LineHeight)>,
scale_factor: f64,
scale_factor: f32,
layout: &TextLayout,
computed: &mut ComputedTextBlock,
font_system: &mut CosmicFontSystem,
Expand Down Expand Up @@ -590,11 +590,11 @@ fn get_attrs<'a>(
text_font: &TextFont,
line_height: LineHeight,
family: Family<'a>,
scale_factor: f64,
scale_factor: f32,
) -> Attrs<'a> {
let font_size = (text_font.font_size * scale_factor as f32).round();
let font_size = (text_font.font_size * scale_factor).round();
let line_height = match line_height {
LineHeight::Px(px) => px * scale_factor as f32,
LineHeight::Px(px) => px * scale_factor,
LineHeight::RelativeToFont(s) => s * font_size,
};

Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ui/src/widget/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ pub fn measure_text_system(
entity,
fonts.as_ref(),
text_reader.iter(entity),
computed_target.scale_factor.into(),
computed_target.scale_factor,
&block,
computed.as_mut(),
&mut font_system,
Expand Down