Merge pull request 'fix(engine): force full board repaint when the decor-view poller fires (#130)' (#155) from fix/130-forced-repaint into master
Build and Deploy / build-and-push (push) Successful in 2m13s
Test / test (push) Successful in 8m7s
Web WASM Rebuild / rebuild (push) Successful in 7m29s

This commit was merged in pull request #155.
This commit is contained in:
2026-07-07 23:14:11 +00:00
+9 -2
View File
@@ -82,7 +82,8 @@ impl Plugin for SafeAreaInsetsPlugin {
); );
#[cfg(target_os = "android")] #[cfg(target_os = "android")]
app.init_resource::<android::SafeAreaPollTries>() app.add_message::<crate::events::StateChangedEvent>()
.init_resource::<android::SafeAreaPollTries>()
.add_systems(Update, android::refresh_insets) .add_systems(Update, android::refresh_insets)
.add_systems(Update, android::rearm_on_resumed) .add_systems(Update, android::rearm_on_resumed)
.add_systems(Update, android::refresh_surface_size); .add_systems(Update, android::refresh_surface_size);
@@ -330,11 +331,16 @@ mod android {
/// `on_window_resized` in `table_plugin` recomputes the board layout, /// `on_window_resized` in `table_plugin` recomputes the board layout,
/// 3. re-arms the inset poller, because a screen change almost always /// 3. re-arms the inset poller, because a screen change almost always
/// moves the system bars too — covering the "re-poll never fires" /// moves the system bars too — covering the "re-poll never fires"
/// hole left open in #116. /// hole left open in #116,
/// 4. emits `StateChangedEvent` so `card_plugin`'s sync pipeline
/// re-renders every card sprite from scratch — belt-and-braces for
/// the transient tableau clip of #130, where geometry converged but
/// stale card visuals survived the relayout.
pub(super) fn refresh_surface_size( pub(super) fn refresh_surface_size(
mut frame: Local<u32>, mut frame: Local<u32>,
mut windows: Query<(Entity, &mut Window)>, mut windows: Query<(Entity, &mut Window)>,
mut resize_events: MessageWriter<WindowResized>, mut resize_events: MessageWriter<WindowResized>,
mut state_events: MessageWriter<crate::events::StateChangedEvent>,
mut poll: ResMut<SafeAreaPollTries>, mut poll: ResMut<SafeAreaPollTries>,
) { ) {
const POLL_INTERVAL_FRAMES: u32 = 30; // ~0.5 s @ 60 fps const POLL_INTERVAL_FRAMES: u32 = 30; // ~0.5 s @ 60 fps
@@ -381,6 +387,7 @@ mod android {
width: decor_w as f32 / scale, width: decor_w as f32 / scale,
height: decor_h as f32 / scale, height: decor_h as f32 / scale,
}); });
state_events.write(crate::events::StateChangedEvent);
poll.0 = 0; poll.0 = 0;
} }