From b5f6df8fece29616cd4e3da46e8e2822f601c93b Mon Sep 17 00:00:00 2001 From: filforce95 <49290121+filforce95@users.noreply.github.com> Date: Fri, 23 Oct 2026 18:31:43 +0200 Subject: [PATCH] test(pickdrag): the second corner is set where the button goes down With clicks counting on press (#1001), a press after the first corner closes the window there even with PICKDRAG 0; letting go elsewhere after a drag changes nothing. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/tests/pickdrag.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/crates/ui-egui/tests/pickdrag.rs b/crates/ui-egui/tests/pickdrag.rs index fe5ad2f8b..8b9e7a96e 100644 --- a/crates/ui-egui/tests/pickdrag.rs +++ b/crates/ui-egui/tests/pickdrag.rs @@ -83,13 +83,11 @@ fn drag_is_disabled_but_two_clicks_still_complete_the_window() { button(&mut h, a, true); button(&mut h, a, false); assert!(h.state().session.pending_window.is_some()); - // A held-button movement after the first click must not consume the second corner. - drag(&mut h, a, b); - assert!(h.state().session.pending_window.is_some()); - assert!(h.state().session.selection().is_empty()); - h.run_steps(30); // Separate deliberate clicks from egui's double-click interval. - button(&mut h, b, true); - button(&mut h, b, false); + // The second corner is where the button goes down (#1001): a drag on from there, let go + // elsewhere, changes nothing. + h.run_steps(30); // Separate deliberate clicks from the double-click interval. + let away = xf.to_screen(Vec2::new(30.0, 8.0)); + drag(&mut h, b, away); assert!(h.state().session.pending_window.is_none()); assert_eq!(h.state().session.selection().len(), 1); }