Canvas: a press that activates another tile reruns the pass, as in #18273

The new craft-libs pin draws the tiles before the press activates the other
document, so the contextual task bar stayed on the old tile for a frame.
The same change as in the craft-libs pin PR #18273, so the two merge cleanly.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
David MannandClaude Opus 5.5 committed 2026-11-30 12:57:07 +01:00
1 parent bebc324fce
commit e3eb649178
1 file changed
+5
@@ -311,6 +311,11 @@ fn arranged(app: &mut PhotocraftApp, ui: &mut egui::Ui, rect: Rect, active: usiz
}
}
if let Some(d) = selected {
// The tiles drew before the press activated another one: run the pass again, so this frame already shows the
// contextual task bar on the new active tile and not on the tile that was active.
if d != active {
ui.ctx().request_discard("a pressed tile became the active document");
}
app.session.set_active(d);
}
// A clean document can leave the session immediately, so close only after the pane indices were used.