remove circular dependency between bevy_sprite and bevy_image (#18379)

# Objective

- #17219 introduced a circular dependency between bevy_image and
bevy_sprite for documentation

## Solution

- Remove the circular dependency
- Simplify the doc example
This commit is contained in:
François Mockers 2025-03-18 02:38:49 +01:00 committed by GitHub
parent 6d6054116a
commit ce392fade8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 5 deletions

View File

@ -79,7 +79,6 @@ half = { version = "2.4.1" }
[dev-dependencies]
bevy_ecs = { path = "../bevy_ecs", version = "0.16.0-dev" }
bevy_sprite = { path = "../bevy_sprite", version = "0.16.0-dev" }
[lints]
workspace = true

View File

@ -173,12 +173,11 @@ impl<'a> TextureAtlasBuilder<'a> {
/// # Usage
///
/// ```rust
/// # use bevy_sprite::prelude::*;
/// # use bevy_ecs::prelude::*;
/// # use bevy_asset::*;
/// # use bevy_image::prelude::*;
///
/// fn my_system(mut commands: Commands, mut textures: ResMut<Assets<Image>>, mut layouts: ResMut<Assets<TextureAtlasLayout>>) {
/// fn my_system(mut textures: ResMut<Assets<Image>>, mut layouts: ResMut<Assets<TextureAtlasLayout>>) {
/// // Declare your builder
/// let mut builder = TextureAtlasBuilder::default();
/// // Customize it
@ -187,8 +186,6 @@ impl<'a> TextureAtlasBuilder<'a> {
/// let (atlas_layout, atlas_sources, texture) = builder.build().unwrap();
/// let texture = textures.add(texture);
/// let layout = layouts.add(atlas_layout);
/// // Spawn your sprite
/// commands.spawn(Sprite::from_atlas_image(texture, TextureAtlas::from(layout)));
/// }
/// ```
///