From 8a449cb98edf71e59289a414f150e21435a07301 Mon Sep 17 00:00:00 2001 From: ncic <1848265+ncic@users.noreply.github.com> Date: Sat, 14 Nov 2026 01:45:40 +0100 Subject: [PATCH] Pencil: badged cursors keep their badge with Use Precise Cursors The Pencil's and the Paintbrush's new-path, continue, close and straight-line cursors are drawn on the crosshair already; Precise Cursors no longer turns them into the plain crosshair, so the badge still says what the press or the release does. --- crates/tools/src/cursor.rs | 9 +++------ crates/tools/src/cursors.toml | 13 +++++++++++-- crates/tools/src/draw2/gesture/tests.rs | 4 ++-- crates/tools/src/lib.rs | 5 ++++- docs/ui-parity.md | 2 +- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/crates/tools/src/cursor.rs b/crates/tools/src/cursor.rs index 85b9cf258e..56e2cd2ae7 100644 --- a/crates/tools/src/cursor.rs +++ b/crates/tools/src/cursor.rs @@ -259,7 +259,9 @@ impl Cursor { /// General › Use Precise Cursors: the drawing tools' pointers (the Pen's in every state, the /// Anchor Point and Curvature tools', the Eyedropper's, the Slice and Blend tools', the Live - /// Paint tools') become a plain crosshair at the hotspot. + /// Paint tools') become a plain crosshair at the hotspot. The Pencil's and the Paintbrush's + /// badged cursors are drawn on the crosshair already and keep their badge, which says what the + /// press or the release does (a new path, continuing, closing, a straight line). pub fn precise(self) -> Self { match self { Cursor::Pen @@ -282,12 +284,7 @@ impl Cursor { | Cursor::Lasso | Cursor::MagicWand | Cursor::Pencil - | Cursor::PencilNew - | Cursor::PencilClose - | Cursor::PencilStraight - | Cursor::PencilContinue | Cursor::Paintbrush - | Cursor::PaintbrushClose | Cursor::BlobBrush | Cursor::Eraser | Cursor::Smooth diff --git a/crates/tools/src/cursors.toml b/crates/tools/src/cursors.toml index 1c15b37d71..efa31a515d 100644 --- a/crates/tools/src/cursors.toml +++ b/crates/tools/src/cursors.toml @@ -628,7 +628,10 @@ hotspot = "The lead tip." [[cursor]] id = "PencilNew" group = "Drawing and editing tools" -shown_when = ["The Pencil tool before a press that draws a new freehand path: the pointer is not within Edit Selected Paths of a selected path that the press would continue from an end or redraw. Over such a path, and while a stroke is drawn, the Pencil cursor has no star."] +shown_when = [ + "The Pencil tool before a press that draws a new freehand path: the pointer is not within Edit Selected Paths of a selected path that the press would continue from an end or redraw. Over such a path, and while a stroke is drawn, the Pencil cursor has no star.", + "With Use Precise Cursors on it shows as well: it is drawn on the crosshair, and the badge stays.", +] hotspot = "The lead tip." look = "The Pencil cursor with a small star badge, where PencilClose has its ring." @@ -639,6 +642,7 @@ shown_when = [ "The Pencil tool with Alt pressed after the drag starts, when Alt key toggles to Smooth Tool is off: releasing the mouse button with Alt still held closes the path. A drag started with Shift or Alt held draws an open straight line and does not show this cursor.", "The Pencil tool while a freehand stroke is drawn back to within Close Paths When Ends Are Within of its start: releasing the mouse button there closes the path.", "The Pencil tool while a stroke continuing a selected open path, freehand or a straight line, is drawn to within Close Paths When Ends Are Within of that path's other end: releasing the mouse button there closes the path.", + "With Use Precise Cursors on it shows as well: it is drawn on the crosshair, and the badge stays.", ] hotspot = "The lead tip." look = "The Pencil cursor with a ring badge (closing the loop), like PenClose." @@ -646,7 +650,10 @@ look = "The Pencil cursor with a ring badge (closing the loop), like PenClose." [[cursor]] id = "PencilStraight" group = "Drawing and editing tools" -shown_when = ["The Pencil tool with Shift or Alt held before a press, except with Alt held when Alt key toggles to Smooth Tool is on: the press draws a straight line, at 45° steps from the Constrain Angle when Shift is held and at any angle with Alt alone."] +shown_when = [ + "The Pencil tool with Shift or Alt held before a press, except with Alt held when Alt key toggles to Smooth Tool is on: the press draws a straight line, at 45° steps from the Constrain Angle when Shift is held and at any angle with Alt alone.", + "With Use Precise Cursors on it shows as well: it is drawn on the crosshair, and the badge stays.", +] hotspot = "The lead tip." look = "The Pencil cursor with a short level-line badge, where PencilClose has its ring." @@ -656,6 +663,7 @@ group = "Drawing and editing tools" shown_when = [ "The Pencil tool over an end of a selected open path, within Edit Selected Paths, before a press, except with Alt held when Alt key toggles to Smooth Tool is on: the press continues the path from that end, freehand, or with a straight line when Shift or Alt is held.", "The Pencil tool while a stroke continuing a selected path ends within Edit Selected Paths of an open end of another path selected at the press: releasing the mouse button connects the two.", + "With Use Precise Cursors on it shows as well: it is drawn on the crosshair, and the badge stays.", ] hotspot = "The lead tip." look = "The Pencil cursor with a short badge line rising to the right, where PencilClose has its ring (the stroke carries on from the path)." @@ -672,6 +680,7 @@ group = "Drawing and editing tools" shown_when = [ "The Paintbrush tool with Alt held while drawing, or before a press when no path is selected that the Smooth tool can act on (with one selected, Smooth shows): releasing the mouse button with Alt still held closes the path.", "The Paintbrush tool while a stroke is drawn back to within Close Paths When Ends Are Within of its start: releasing the mouse button there closes the path.", + "With Use Precise Cursors on it shows as well: it is drawn on the crosshair, and the badge stays.", ] hotspot = "The bristle tip." look = "The Paintbrush cursor with a ring badge (closing the loop), like PenClose." diff --git a/crates/tools/src/draw2/gesture/tests.rs b/crates/tools/src/draw2/gesture/tests.rs index 65ad5f00e7..8ff1ac3d67 100644 --- a/crates/tools/src/draw2/gesture/tests.rs +++ b/crates/tools/src/draw2/gesture/tests.rs @@ -748,7 +748,7 @@ fn pencil_shows_the_straight_line_cursor_when_a_press_draws_a_line() { t.pointer(&cx, &PointerEvent::new(PointerKind::Drag, 40.0, -10.0).with_mods(shift)); assert_eq!(t.cursor(&cx, at, shift), Cursor::Pencil, "a freehand stroke"); assert_eq!(GestureTool::new("paintbrush").cursor(&cx, at, shift), Cursor::Paintbrush); - assert_eq!(Cursor::PencilStraight.precise(), Cursor::Crosshair, "Use Precise Cursors"); + assert_eq!(Cursor::PencilStraight.precise(), Cursor::PencilStraight, "Use Precise Cursors keeps the badge"); } /// Before a press, the Pencil shows its new-path cursor (the star) exactly when the press draws @@ -883,7 +883,7 @@ fn pencil_shows_the_continuation_cursor_over_an_end_a_line_continues() { let cx_none = crate::testutil::cx(&d, &none, &p); assert_eq!(GestureTool::new("pencil").cursor(&cx_none, end, shift), Cursor::PencilStraight, "nothing selected"); assert_eq!(GestureTool::new("paintbrush").cursor(&cx, end, shift), Cursor::Paintbrush); - assert_eq!(Cursor::PencilContinue.precise(), Cursor::Crosshair, "Use Precise Cursors"); + assert_eq!(Cursor::PencilContinue.precise(), Cursor::PencilContinue, "Use Precise Cursors keeps the badge"); } /// A Pencil stroke continuing a selected path shows the continuation cursor while a release would diff --git a/crates/tools/src/lib.rs b/crates/tools/src/lib.rs index 17e6f038e9..1a629d7ab8 100644 --- a/crates/tools/src/lib.rs +++ b/crates/tools/src/lib.rs @@ -660,7 +660,10 @@ mod cursor_tests { // Away from a selected path the Pencil shows its new-path cursor, drawn with a star; its // own cursor, for drawing and for a selected path under the pointer, borrows the crosshair. assert_eq!(cursor_at("pencil", &d, away), Cursor::PencilNew); - assert_eq!(Cursor::PencilNew.precise(), Cursor::Crosshair); + // Its badged cursors are drawn on the crosshair, and Use Precise Cursors keeps the badge. + for c in [Cursor::PencilNew, Cursor::PencilClose, Cursor::PencilStraight, Cursor::PencilContinue, Cursor::PaintbrushClose] { + assert_eq!(c.precise(), c, "{c:?}"); + } assert_eq!(Cursor::PencilNew.stand_in(), None); assert_eq!(Cursor::Pencil.precise(), Cursor::Crosshair); assert_eq!(Cursor::Pencil.stand_in(), Some(Cursor::Crosshair)); diff --git a/docs/ui-parity.md b/docs/ui-parity.md index a7adedb22d..8b97b1a88b 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -341,7 +341,7 @@ tools, never checked side by side) isn't captured row by row. | Polygon/Star exact-size placement remembers the chosen sides/points for later drags and dialog openings; Cancel preserves the previous count | done | Session tool options; existing dialog-opening gestures retained; regression in `toolbar.rs` | | Tool double-click opens its options | done | | | Per-platform mapping (Cmd ↔ Ctrl, Option ↔ Alt) | done | | -| Eyedropper cursor; Use Precise Cursors | partial | original pipette at the sampling tip, distinct from the precise crosshair at five DPI scales (#1269); OS cursor display unverified; while Caps Lock is on, the tools that Use Precise Cursors changes show the crosshair, and the saved preference does not change (the desktop app reads the lock state on macOS, Windows and Linux X11, not on native Wayland; `view.capsLock` reads or sets it); a Use Precise Cursors command toggles the preference and can take a shortcut (#1663); cursors are painted into the window on Wayland (#1652, not run on Linux) | +| Eyedropper cursor; Use Precise Cursors | partial | original pipette at the sampling tip, distinct from the precise crosshair at five DPI scales (#1269); OS cursor display unverified; while Caps Lock is on, the tools that Use Precise Cursors changes show the crosshair, and the saved preference does not change; the Pencil's and the Paintbrush's cursors with a badge (new path, continue, close, straight line) are drawn on the crosshair and keep their badge (the desktop app reads the lock state on macOS, Windows and Linux X11, not on native Wayland; `view.capsLock` reads or sets it); a Use Precise Cursors command toggles the preference and can take a shortcut (#1663); cursors are painted into the window on Wayland (#1652, not run on Linux) | | macOS canvas cursor delivery (#2292) | partial | The UI prepares the existing glyphs as aligned 1×/2× RGBA requests; the desktop host builds AppKit cursors and owns cursor rectangles for the root document window. While it owns the cursor, the host sets it again on every pass, so the tool's cursor stays when the pointer moves (#6362). Detached document viewports and requests without a usable native bitmap retain the visible system fallback; precise-cursor and UI-scale preferences retained. Headless regressions cover routing, pixels/hotspots and lifecycle; native focus/menu/handback timing, mixed displays, Spotlight and full-screen Spaces remain unverified. Wayland still paints its glyphs. | | Every tool's modifiers checked against the shortcut reference | missing | this is the fidelity pass |