|
18 | 18 | //! Please report issues, submit fixes and propose changes.
|
19 | 19 | //! Thanks for stress-testing; let's build something better together.
|
20 | 20 |
|
21 |
| -use bevy_app::{HierarchyPropagatePlugin, Plugin, PostUpdate, Update}; |
| 21 | +use bevy_app::{HierarchyPropagatePlugin, Plugin, PostUpdate, PropagateSet}; |
22 | 22 | use bevy_asset::embedded_asset;
|
23 |
| -use bevy_ecs::query::With; |
| 23 | +use bevy_ecs::{query::With, schedule::IntoScheduleConfigs}; |
24 | 24 | use bevy_text::{TextColor, TextFont};
|
| 25 | +use bevy_ui::UiSystems; |
25 | 26 | use bevy_ui_render::UiMaterialPlugin;
|
26 | 27 |
|
27 | 28 | use crate::{
|
@@ -63,11 +64,18 @@ impl Plugin for FeathersPlugin {
|
63 | 64 | app.add_plugins((
|
64 | 65 | ControlsPlugin,
|
65 | 66 | CursorIconPlugin,
|
66 |
| - HierarchyPropagatePlugin::<TextColor, With<ThemedText>>::new(Update), |
67 |
| - HierarchyPropagatePlugin::<TextFont, With<ThemedText>>::new(Update), |
| 67 | + HierarchyPropagatePlugin::<TextColor, With<ThemedText>>::new(PostUpdate), |
| 68 | + HierarchyPropagatePlugin::<TextFont, With<ThemedText>>::new(PostUpdate), |
68 | 69 | UiMaterialPlugin::<AlphaPatternMaterial>::default(),
|
69 | 70 | ));
|
70 | 71 |
|
| 72 | + // This needs to run in UiSystems::Propagate so the fonts are up-to-date for `measure_text_system` |
| 73 | + // and `detect_text_needs_rerender` in UiSystems::Content |
| 74 | + app.configure_sets( |
| 75 | + PostUpdate, |
| 76 | + PropagateSet::<TextFont>::default().in_set(UiSystems::Propagate), |
| 77 | + ); |
| 78 | + |
71 | 79 | app.insert_resource(DefaultCursor(EntityCursor::System(
|
72 | 80 | bevy_window::SystemCursorIcon::Default,
|
73 | 81 | )));
|
|
0 commit comments