Skip to content

Commit 73c1ab1

Browse files
committed
Fix bevy_ui compile error without bevy_text (#7877)
# Objective - Fixes #7874. - The `bevy_text` dependency is optional for `bevy_ui`, but the `accessibility` module depended on it. ## Solution - Guard the `accessibility` module behind the `bevy_text` feature and only add the plugin when it's enabled.
1 parent fc7a3bd commit 73c1ab1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/bevy_ui/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ mod render;
99
mod stack;
1010
mod ui_node;
1111

12+
#[cfg(feature = "bevy_text")]
1213
mod accessibility;
1314
pub mod camera_config;
1415
pub mod node_bundles;
@@ -103,7 +104,6 @@ impl Plugin for UiPlugin {
103104
.register_type::<Val>()
104105
.register_type::<widget::Button>()
105106
.register_type::<widget::Label>()
106-
.add_plugin(accessibility::AccessibilityPlugin)
107107
.configure_set(UiSystem::Focus.in_base_set(CoreSet::PreUpdate))
108108
.configure_set(UiSystem::Flex.in_base_set(CoreSet::PostUpdate))
109109
.configure_set(UiSystem::Stack.in_base_set(CoreSet::PostUpdate))
@@ -124,6 +124,8 @@ impl Plugin for UiPlugin {
124124
// they will never observe each other's effects.
125125
.ambiguous_with(bevy_text::update_text2d_layout),
126126
);
127+
#[cfg(feature = "bevy_text")]
128+
app.add_plugin(accessibility::AccessibilityPlugin);
127129
app.add_system({
128130
let system = widget::update_image_calculated_size_system
129131
.in_base_set(CoreSet::PostUpdate)

0 commit comments

Comments
 (0)