From ce392fade85fc8dfd33dd18e6833634a9a9cd2cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Tue, 18 Mar 2025 02:38:49 +0100 Subject: [PATCH] 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 --- crates/bevy_image/Cargo.toml | 1 - crates/bevy_image/src/texture_atlas_builder.rs | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/crates/bevy_image/Cargo.toml b/crates/bevy_image/Cargo.toml index b05218c3ea..ea7c5abee7 100644 --- a/crates/bevy_image/Cargo.toml +++ b/crates/bevy_image/Cargo.toml @@ -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 diff --git a/crates/bevy_image/src/texture_atlas_builder.rs b/crates/bevy_image/src/texture_atlas_builder.rs index 1da85005a2..b7fd2cf168 100644 --- a/crates/bevy_image/src/texture_atlas_builder.rs +++ b/crates/bevy_image/src/texture_atlas_builder.rs @@ -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>, mut layouts: ResMut>) { + /// fn my_system(mut textures: ResMut>, mut layouts: ResMut>) { /// // 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))); /// } /// ``` ///