Skip to content

Commit

Permalink
cargo fmt --all
Browse files Browse the repository at this point in the history
  • Loading branch information
ickshonpe committed Sep 5, 2023
1 parent edfdbaf commit 068098f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
11 changes: 7 additions & 4 deletions crates/bevy_sprite/src/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,11 @@ pub fn prepare_sprites(
for item_index in 0..transparent_phase.items.len() {
let item = transparent_phase.items[item_index].entity;
let mut batch_image_changed = false;
if let Some(extracted_sprite) = extracted_sprites.sprites.get(item).or_else(|| extracted_batches.sprites.get(item)) {
if let Some(extracted_sprite) = extracted_sprites
.sprites
.get(item)
.or_else(|| extracted_batches.sprites.get(item))
{
if batch_image_handle != extracted_sprite.image_handle_id {
batch_image_changed = true;
}
Expand Down Expand Up @@ -795,7 +799,7 @@ pub fn prepare_sprites(
// done by invalidating the batch_image_handle
batch_image_handle = HandleId::Id(Uuid::nil(), u64::MAX);
continue;
};
};
}
}
sprite_meta
Expand Down Expand Up @@ -915,5 +919,4 @@ impl<P: PhaseItem> RenderCommand<P> for DrawSpriteBatch {
pass.draw_indexed(0..6, 0, batch.range.clone());
RenderCommandResult::Success
}

}
}
9 changes: 2 additions & 7 deletions crates/bevy_text/src/text2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ use bevy_render::{
view::{InheritedVisibility, ViewVisibility, Visibility},
Extract,
};
use bevy_sprite::{
Anchor, TextureAtlas, ExtractedSpriteBatches, ExtractedSprite,
};
use bevy_sprite::{Anchor, ExtractedSprite, ExtractedSpriteBatches, TextureAtlas};
use bevy_transform::prelude::{GlobalTransform, Transform};
use bevy_utils::HashSet;
use bevy_window::{PrimaryWindow, Window, WindowScaleFactorChanged};
Expand Down Expand Up @@ -148,10 +146,7 @@ pub fn extract_text2d_sprite(
glyph_ids.push(sprite_id);
extracted_batches.sprites.insert(sprite_id, sprite);
}
extracted_batches.batches.insert(
entity,
glyph_ids,
);
extracted_batches.batches.insert(entity, glyph_ids);
}
}

Expand Down

0 comments on commit 068098f

Please sign in to comment.