Skip to content

feat: Scribbble-style tools — shapes, keyboard shortcuts, bigger palette#7

Closed
ajianaz wants to merge 1 commit into
developfrom
feat/scribble-tools
Closed

feat: Scribbble-style tools — shapes, keyboard shortcuts, bigger palette#7
ajianaz wants to merge 1 commit into
developfrom
feat/scribble-tools

Conversation

@ajianaz

@ajianaz ajianaz commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

What's New

Adopted patterns from Scribbble (scribbble.app) and DrawPen (drawpen.app) — the two leading open-source screen annotation apps.

New Drawing Tools (4)

Tool Key Behavior
Line L Straight line from drag start → end
Arrow A Line with auto-sized arrowhead
Rectangle R Stroke rectangle from bounding box
Ellipse O Stroke ellipse from bounding box

Shapes store only start+end points → crisp rendering at any zoom. Arrow head scales with brush width.

Keyboard Shortcuts (draw mode ON)

Key Action
P H L A R O E Switch tool
17 Quick color (red, orange, yellow, green, blue, purple, white)
+ / - Brush thickness up/down
⌘Z Undo
⌘K Clear all

Toolbar Improvements

  • 7 colors (was 4) — added orange, blue, purple
  • Brush size control — − / + buttons with live pixel readout
  • Shape preview — shapes render live during drag
  • Shortcut hints — key letters in tooltips
  • Brand color — active tool highlight uses DrawOver orange (#EF593F)

Technical

  • Tool type extended: 'line' | 'arrow' | 'rectangle' | 'ellipse'
  • Shape strokes store 2 points (start+end), not full path
  • drawShape() handles all 4 shape types in both commit + preview mode
  • drawArrowHead() computes arrowhead from brush width
  • Full backward compat — existing pen/highlighter/eraser strokes unchanged

Files Changed

  • src/lib/types.ts — Tool type + shapes
  • src/lib/Toolbar.svelte — 7 tools, 7 colors, brush size, shortcut hints
  • src/routes/+page.svelte — shape rendering, keyboard handler, shape preview

Check

svelte-check: 0 errors, 0 warnings ✅

…r palette

Added tools:
- Line (L) — straight line from drag
- Arrow (A) — line with arrowhead, auto-sized to brush width
- Rectangle (R) — stroke rectangle from drag
- Ellipse (O) — stroke ellipse from drag

Keyboard shortcuts (when draw mode ON):
- P/H/L/A/R/O/E — switch tools
- 1-7 — quick color select (red/orange/yellow/green/blue/purple/white)
- +/- — brush thickness
- Cmd+Z — undo
- Cmd+K — clear all

Toolbar improvements:
- 7 colors (was 4) — added orange, blue, purple
- Brush size control with − and + buttons + live readout
- Shape tools render as stroke preview during drag
- Tool shortcut letters shown in tooltips
- Active tool highlight uses brand orange (#EF593F)

Shape rendering:
- Shapes store only start+end points (not full path)
- Arrow head length scales with brush width
- Ellipse uses center+radius from bounding box
- Shapes render in redraw loop alongside freehand strokes

Inspired by: Scribbble (scribbble.app), DrawPen (drawpen.app)
@ajianaz

ajianaz commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

Closing for now — depends on draw-mode toggle (PR 6) to be reachable. Will reopen rebased.

@ajianaz ajianaz closed this Jul 12, 2026
@ajianaz ajianaz deleted the feat/scribble-tools branch July 12, 2026 01:37
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