Skip to content

Commit

Permalink
Remove the atlas_scaling field from ExtractedUiItem::Gylphs. (bev…
Browse files Browse the repository at this point in the history
…yengine#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.
  • Loading branch information
ickshonpe authored Jan 1, 2025
1 parent 5f1e762 commit 0141bd0
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions crates/bevy_ui/src/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<usize>,
},
Expand Down Expand Up @@ -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(),
},
);
Expand Down Expand Up @@ -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()] {
Expand Down

0 comments on commit 0141bd0

Please sign in to comment.