From 0141bd01b3a6f1130f2aaabb2d3ab3ea4b9719d8 Mon Sep 17 00:00:00 2001 From: ickshonpe Date: Wed, 1 Jan 2025 04:06:53 +0000 Subject: [PATCH] Remove the `atlas_scaling` field from `ExtractedUiItem::Gylphs`. (#17047) # Objective Remove the `atlas_scaling` field from `ExtractedUiItem::Gylphs`. It's only ever set to `Vec2::ONE`. I don't remember why/if this field was ever needed, maybe it was useful before the scale factor clean up. ## Migration Guide The `atlas_scaling` field from `ExtractedUiItem::Gylphs` has been removed. This shouldn't affect any existing code as it wasn't used for anything. --- crates/bevy_ui/src/render/mod.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/crates/bevy_ui/src/render/mod.rs b/crates/bevy_ui/src/render/mod.rs index 84a458921c..54795e885f 100644 --- a/crates/bevy_ui/src/render/mod.rs +++ b/crates/bevy_ui/src/render/mod.rs @@ -226,7 +226,6 @@ pub enum ExtractedUiItem { }, /// A contiguous sequence of text glyphs from the same section Glyphs { - atlas_scaling: Vec2, /// Indices into [`ExtractedUiNodes::glyphs`] range: Range, }, @@ -716,10 +715,7 @@ pub fn extract_text_sections( clip: clip.map(|clip| clip.clip), camera_entity: render_camera_entity.id(), rect, - item: ExtractedUiItem::Glyphs { - atlas_scaling: Vec2::ONE, - range: start..end, - }, + item: ExtractedUiItem::Glyphs { range: start..end }, main_entity: entity.into(), }, ); @@ -1114,15 +1110,12 @@ pub fn prepare_uinodes( vertices_index += 6; indices_index += 4; } - ExtractedUiItem::Glyphs { - atlas_scaling, - range, - } => { + ExtractedUiItem::Glyphs { range } => { let image = gpu_images .get(extracted_uinode.image) .expect("Image was checked during batching and should still exist"); - let atlas_extent = image.size_2d().as_vec2() * *atlas_scaling; + let atlas_extent = image.size_2d().as_vec2(); let color = extracted_uinode.color.to_f32_array(); for glyph in &extracted_uinodes.glyphs[range.clone()] {