Skip to content

Commit 5ed6b62

Browse files
authored
Allow bevy_ui crate to compile without the text feature enabled (#8437)
# Objective Allow `bevy_ui` crate to compile without the `text` feature enabled ## Solution - Correctly conditionally compile `text_system`
1 parent 3220ad6 commit 5ed6b62

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

crates/bevy_ui/src/lib.rs

+14-12
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,20 @@ impl Plugin for UiPlugin {
124124
#[cfg(feature = "bevy_text")]
125125
app.add_systems(
126126
PostUpdate,
127-
widget::measure_text_system
128-
.before(UiSystem::Layout)
129-
// Potential conflict: `Assets<Image>`
130-
// In practice, they run independently since `bevy_render::camera_update_system`
131-
// will only ever observe its own render target, and `widget::measure_text_system`
132-
// will never modify a pre-existing `Image` asset.
133-
.ambiguous_with(CameraUpdateSystem)
134-
// Potential conflict: `Assets<Image>`
135-
// Since both systems will only ever insert new [`Image`] assets,
136-
// they will never observe each other's effects.
137-
.ambiguous_with(bevy_text::update_text2d_layout),
127+
(
128+
widget::measure_text_system
129+
.before(UiSystem::Layout)
130+
// Potential conflict: `Assets<Image>`
131+
// In practice, they run independently since `bevy_render::camera_update_system`
132+
// will only ever observe its own render target, and `widget::measure_text_system`
133+
// will never modify a pre-existing `Image` asset.
134+
.ambiguous_with(CameraUpdateSystem)
135+
// Potential conflict: `Assets<Image>`
136+
// Since both systems will only ever insert new [`Image`] assets,
137+
// they will never observe each other's effects.
138+
.ambiguous_with(bevy_text::update_text2d_layout),
139+
widget::text_system.after(UiSystem::Layout),
140+
),
138141
);
139142
#[cfg(feature = "bevy_text")]
140143
app.add_plugin(accessibility::AccessibilityPlugin);
@@ -159,7 +162,6 @@ impl Plugin for UiPlugin {
159162
.before(TransformSystem::TransformPropagate),
160163
ui_stack_system.in_set(UiSystem::Stack),
161164
update_clipping_system.after(TransformSystem::TransformPropagate),
162-
widget::text_system.after(UiSystem::Layout),
163165
),
164166
);
165167

0 commit comments

Comments
 (0)