From aabf48728ea10f96517f6e1888550657adbb1203 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sat, 24 Oct 2026 10:04:41 -0400 Subject: [PATCH] Pencil: the closing ring tests the point a release keeps A Paintbrush sample dropped for being under a pixel from the last point left the ring computed from the pointer, while the release keeps the last point; the ring now follows that point (CodeRabbit). Co-Authored-By: Claude Opus 5.5 --- crates/tools/src/draw2/gesture.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/tools/src/draw2/gesture.rs b/crates/tools/src/draw2/gesture.rs index 0f2274670..4806b42a2 100644 --- a/crates/tools/src/draw2/gesture.rs +++ b/crates/tools/src/draw2/gesture.rs @@ -398,7 +398,11 @@ impl Tool for GestureTool { } self.points.truncate(1); } else if self.points.last().is_some_and(|l| l.distance(p) < cx.tol(1.0)) || self.points.len() >= crate::MAX_STROKE_SAMPLES { - self.near_start = self.release_closes_near_start(cx, end); + // A release here keeps the last point unless it snaps (`Up`), so the ring + // follows the point `finish` will test. + let kept = self.points.last().copied().filter(|l| l.distance(p) < cx.tol(1.0) && !self.snaps()); + let release_end = kept.unwrap_or(end); + self.near_start = self.release_closes_near_start(cx, release_end); return vec![]; } self.push(p, ev.pressure);