diff --git a/crates/bevy_ui/src/render/mod.rs b/crates/bevy_ui/src/render/mod.rs index ecd97e6d6bf869..b00e3d85cd5afd 100644 --- a/crates/bevy_ui/src/render/mod.rs +++ b/crates/bevy_ui/src/render/mod.rs @@ -23,7 +23,7 @@ use bevy_render::{ view::{ExtractedView, ViewUniforms, Visibility}, RenderApp, RenderStage, RenderWorld, }; -use bevy_sprite::{Rect, SpriteAssetEvents, SpriteSheet, TextureAtlas}; +use bevy_sprite::{Rect, SpriteAssetEvents, TextureAtlas, TextureSheet}; use bevy_text::{DefaultTextPipeline, Text}; use bevy_transform::components::GlobalTransform; use bevy_utils::FloatOrd; @@ -183,7 +183,7 @@ pub fn extract_uinodes( &UiColor, &UiImage, &Visibility, - Option<&SpriteSheet>, + Option<&TextureSheet>, Option<&CalculatedClip>, )>, ) { @@ -196,9 +196,12 @@ pub fn extract_uinodes( } let image = image.0.clone_weak(); - let sheet: Option<&SpriteSheet> = sheet; let (atlas_size, rect_min) = sheet - .and_then(|s| texture_atlases.get(&s.texture_atlas).map(|a| (a, s.index))) + .and_then(|s| { + texture_atlases + .get(&s.texture_atlas) + .map(|a| (a, s.texture_index)) + }) .and_then(|(atlas, index)| { atlas .textures diff --git a/examples/ui/button.rs b/examples/ui/button.rs index 06016a7d396f08..b9158b6de0edc3 100644 --- a/examples/ui/button.rs +++ b/examples/ui/button.rs @@ -46,20 +46,20 @@ fn button_system( fn sheet_button_system( mut interaction_query: Query< - (&Interaction, &mut SpriteSheet), + (&Interaction, &mut TextureSheet), (Changed, With