Skip to content

Brush ink, highlighter, and Blender-style image links for annotations - #68

Merged
sounak1125 merged 1 commit into
mainfrom
feat/annotation-ink-arrows
Oct 9, 2026
Merged

sounak1125 merged 1 commit into
mainfrom
feat/annotation-ink-arrows

Conversation

@sounak1125

Copy link
Copy Markdown
Owner

What changes

Brush and Highlighter (Draw → Annotate)

  • Non-destructive ink items drawn above images and notes; pixels are never touched.
  • Tapered, pressure/speed-shaped nib (real pen pressure when available); strokes written together merge into one item.
  • Highlighter defaults to yellow with its own colour, and blends multiply + a faint screen pass so text under it stays crisp on light and dark images.
  • Cursor previews the nib at its real size and colour.

Arrows

  • Tapered shaft, swept head, and a contrast outline so marks read on any image. Shift locks the angle in 15° steps.
  • Dragging from one image/note onto a different one makes a link drawn like a Blender node link: square to each edge, spread along shared edges, re-routed every frame so it follows moves, resizes, rotation, undo and reopen.
  • Link ends unplug/re-plug by dragging; deleting an item deletes its links (undo restores both). An arrow drawn within one image stays a plain annotation arrow.

Selection bar: colour swatches, thinner/thicker, solid/dotted, arrowheads (end/both/none), contrast outline, each one undo step.

Fix: double-click with an annotation tool, or on an annotation, no longer refits the view.

Behaviour changes

  • Existing arrows render in the new style (outline on).
  • Annotation tools keep their own screen-relative widths (arrow/brush 3, highlighter 16) instead of sharing the pen width. smoke-image-edit-isolation now asserts the arrow's own 3px width; its intent (never the eraser width) is unchanged.
  • Boards saved with ink opened in older versions drop the ink items.

Tests

  • scripts/test-annotation-geometry.mjs (in npm test): stroke outlines, taper, link sides/sockets/curves, socket spreading, pressure, halo colour, build wiring.
  • scripts/smoke-annotations.mjs (test:annotations-smoke, CI step): real CDP mouse input for writing, highlighter, link create/move/unplug/re-plug/delete+undo, restyle+undo, hit tests, double-tap guard, save/reopen. The double-tap assertion was checked to fail with the guard removed.
  • Draw time on the 2,000-item spatial smoke unchanged at 0.29 ms.

🤖 Generated with Claude Code

Annotate gains a Brush and a Highlighter that draw non-destructive ink
items above images and notes: pressure- and speed-shaped tapered strokes
(real pen pressure when available), strokes written together merge into
one item, and the highlighter blends multiply plus a faint screen pass so
text under it stays crisp on light and dark images.

Arrows get a tapered shaft, a swept head and a contrast outline. Dragging
from one image or note onto another makes a link drawn like a Blender node
link: square to each edge, spread along shared edges, re-routed every frame
so it follows moves, resizes, rotation, undo and reopen. Link ends unplug
and re-plug by dragging; deleting an item deletes its links.

A selection bar section restyles annotations (colour, width, solid/dotted,
heads, outline) as one undo step. Annotation tools keep their own
screen-relative widths. Double-clicks with an annotation tool or on an
annotation no longer refit the view.

Geometry lives in scripts/annotation-geometry.mjs with unit tests;
smoke-annotations drives the whole flow with real mouse input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sounak1125
sounak1125 merged commit e5eb408 into main Oct 9, 2026
2 checks passed
@sounak1125 sounak1125 mentioned this pull request Oct 9, 2026
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