Skip to content

Pen cursor: the dot under a hovering Pencil is the line's own size, the highlighter a circle (#400) - #409

Merged
Joost-8 merged 5 commits into
mainfrom
feat-pen-cursor
Dec 3, 2026
Merged

Joost-8 merged 5 commits into
mainfrom
feat-pen-cursor

Conversation

@Joost-8

@Joost-8 Joost-8 commented Dec 3, 2026 •

Copy link
Copy Markdown
Owner

Not verified on device: the iPad bridge was held by another session. Sizes and timing were measured in the gallery (Chromium).

What changed and why

The pen's cursor under a hovering Pencil (beta) was at least 11 px with a thick rim, about eight times as wide as a thin line, and the highlighter showed a tall bar. Now it looks like the pen in hand: a ball pen is a dot as wide as its line (at least 3 px, with a slim rim), and the highlighter is a circle as wide as it marks (a bar only with the chisel tip). Both are in the pen's colour. The laser keeps its preview colour (#380). A Linux desk tablet (#266) keeps the larger dot, because its pen is away from the screen. Part of discussion #400 (item 2).

Proof

  • Tests: tests/view/pen-cursor.test.ts, "under a hovering pen (discussion more requests #400)": true size, the 3 px minimum, NaN width, and the mouse, laser and chisel unchanged; the highlighter is a circle, or a bar with chisel; the offset snaps to device pixels. tests/view/ink-surface.test.ts, "shows the highlighter's tip: a circle, or a bar with the chisel" (fails without the tip in the cache key).
  • Screens: review page. Default pen 11 → 6 px, thick pen → 9 px, highlighter 12×32 bar → 32 px circle, laser unchanged at 24 px.
  • Lag, measured with CDP in the gallery: 0 layouts per hover move, about 0.15 ms of script per move, and the position is written in the next animation frame (which paints in the same update). The remaining lag comes from how hover events arrive, not from us. One thing was ours: positions were rounded to whole CSS pixels, so a slow move went in steps. They now snap to device pixels.
  • npm run gates: all steps pass. check.mjs --changed: 772 renders; the only findings are the 7 groups main already has.
  • Guide entry penCursor updated; npm run guide was run.

Test on the device

  1. Pen settings › Cursor over the page: Ink dot. Hover the Pencil over the page with a thin ball pen: the dot is about the line's width, in the pen's colour.
  2. Pick the highlighter: the dot is a circle as wide as the highlight. Set the chisel tip: it becomes a bar.
  3. Pick the laser and hover: its dot keeps the laser's colour. Back on the pen, hover slowly across a line: the dot moves with the Pencil.

Not verified

  • On the iPad: the size, and whether the cursor still lags behind the Pencil. If iPadOS sends whole-pixel hover positions, the device-pixel snapping changes nothing there.
  • On a Linux desk tablet: kept on the larger dot by code, not seen on a device.
  • On desktop, the mouse's highlighter cursor also changes from a bar to a circle, because it now shows the round tip. This is meant, but say if the bar should stay for the mouse.

🤖 Generated with Claude Code

Joost-8 and others added 4 commits December 3, 2026 00:36
…highlighter a circle of its width (discussion #400)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…esk tablet keeps the larger dot (#266); guide entry

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Joost-8
Joost-8 marked this pull request as ready for review December 3, 2026 18:19
@Joost-8
Joost-8 merged commit 14e9da9 into main Dec 3, 2026
1 check passed
@Joost-8
Joost-8 deleted the feat-pen-cursor branch December 3, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant