From 2c7ce20114e804bafab2e6b6350f01a37c207be6 Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 17 Nov 2026 00:29:18 +0000 Subject: [PATCH] Empty-part cursor: copy the part result before the cursor call --- crates/draw/src/ui/pen/bezier/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/draw/src/ui/pen/bezier/mod.rs b/crates/draw/src/ui/pen/bezier/mod.rs index 32d580dc9..a9c5bff6f 100644 --- a/crates/draw/src/ui/pen/bezier/mod.rs +++ b/crates/draw/src/ui/pen/bezier/mod.rs @@ -833,13 +833,13 @@ impl<'a> BezierOverlay<'a> { if matches!(self.tool, BezierTool::AddAnchor | BezierTool::DeleteAnchor) && let Some(result) = cx.part_if_declared(EMPTY) { + let (press, hover) = (result.press, result.hover_pos); // The part covers the canvas background, so it owns the cursor the host tool shows off the paths too. - if result.hover_pos.is_some() { + if hover.is_some() { let tool = if self.tool == BezierTool::AddAnchor { PathTool::AddAnchor } else { PathTool::DeleteAnchor }; - let cursor = cursor_of(tool, result.press.mods, space.precise()); - cx.cursor(Cursor::Painted(cursor), CursorPriority::Part); + cx.cursor(Cursor::Painted(cursor_of(tool, press.mods, space.precise())), CursorPriority::Part); } - if matches!(result.press.phase, PressPhase::Down { start, .. } if start.button == PointerButton::Primary) { + if matches!(press.phase, PressPhase::Down { start, .. } if start.button == PointerButton::Primary) { self.report.pressed_empty = true; } }