fix(control): check the picker gesture guard on the driven canvas

The sampling guard named the active document's main canvas while the queueing
route drives the canvas this request picked (the top dialog's own, else the
main one). Read the gesture state on that same canvas: ToolHost::in_gesture
(ctx, canvas) in place of canvas::tools::in_gesture(app). With a Color Picker
as the top dialog its declared canvas is the one the events would drive, so
the two reads answer the same today and every existing guard stays green;
the guard now states what it means.
This commit is contained in:
hnoerenberg committed 2026-11-28 13:23:51 +01:00
1 parent 7a93c30d18
commit 5488eb4d4c
1 file changed
+1 -1
+1 -1
View File
@@ -1261,7 +1261,7 @@ fn pointer(app: &mut PhotocraftApp, ctx: &egui::Context, p: &Value) -> Reply {
// over the canvas, so the picker's own controls would take the synthetic events as clicks. A gesture
// the canvas is already running keeps its tool to its release (the picker's pick begins at the next press).
if button == PointerButton::Primary
&& !crate::canvas::tools::in_gesture(app)
&& !ToolHost::in_gesture(ctx, canvas)
&& crate::dialogs::canvas_input::armed(app) == Some(crate::dialogs::canvas_input::DialogPick::Color)
{
let mut held = false;