From 6dfcb167f083036796469082349a39f415aef932 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sun, 22 Nov 2026 18:26:41 +0700 Subject: [PATCH] ui-canvas: a resting pass that hovers for a stir takes the hover owed after a press, so the selected tool gets no late hover once a momentary tool lets go --- crates/ui-canvas/src/canvas/tool_host.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/ui-canvas/src/canvas/tool_host.rs b/crates/ui-canvas/src/canvas/tool_host.rs index 91f5226d6..7973da87e 100644 --- a/crates/ui-canvas/src/canvas/tool_host.rs +++ b/crates/ui-canvas/src/canvas/tool_host.rs @@ -1361,12 +1361,12 @@ impl<'a, 't: 'a> Run<'a, 't> { // the edge band gets a hover at its own position in every pass, since the view scrolls under it. The // first resting pass after a press hovers too: the press dropped the tip, and a pointer that came up // where it went down gets it back (WordCraft showed a link's tip again after a Ctrl+click on it). - if let Some(pointer) = hover_pointer(frame, *press) - && (pointer::with_pass_pointer(self.ctx, |pass| pass.stirred) - || std::mem::take(&mut self.state.rehover) - || self.hover_edge(pointer.pos).is_some()) - { - self.hover(pointer); + // A resting pass that hovers for a stir is that first hover too, so none is left owed to a later pass. + if let Some(pointer) = hover_pointer(frame, *press) { + let rehover = std::mem::take(&mut self.state.rehover); + if pointer::with_pass_pointer(self.ctx, |pass| pass.stirred) || rehover || self.hover_edge(pointer.pos).is_some() { + self.hover(pointer); + } } } PressPhase::Down { start, .. } => {