Skip to content

feat(image-editor): wire Dodge tool — paint a stroke that brightens pixels#42

Merged
lyfuci merged 1 commit intomainfrom
feat/image-editor-dodge-tool
Apr 24, 2026
Merged

feat(image-editor): wire Dodge tool — paint a stroke that brightens pixels#42
lyfuci merged 1 commit intomainfrom
feat/image-editor-dodge-tool

Conversation

@lyfuci
Copy link
Copy Markdown
Owner

@lyfuci lyfuci commented Apr 24, 2026

Summary

Promotes the Dodge (O) tool from stub to functional. Drag on the canvas
to paint a stroke that brightens the underlying pixels. Same idea as
PS's Dodge: each layer represents one stroke, layer opacity controls
intensity, and repeated strokes build up.

Implementation

  • `BrushShape` gains an optional `mode: 'dodge' | 'burn'` field. When
    set, `drawBrush` overrides the stroke color (white for dodge, black
    for burn) and the composite operation (`'lighter'` / `'multiply'`).
    Per-layer save/restore around `drawShape` already isolates these
    changes from siblings.
  • `Canvas.tsx` adds a `tool === 'dodge'` branch that creates a brush
    layer with `mode: 'dodge'` and default opacity 30 so a single stroke
    gives a soft brighten — repeat to build up.
  • `OptionsBar` shares the brush variant (stroke width slider) and adds
    a dodge-specific hint.
  • `LayersPanel` labels dodge / burn brushes distinctly.
  • The `'burn'` mode is wired in the data model + drawing path + label
    table but no UI tool selects it yet — folded in so a future Burn-tool
    PR is a one-line palette change.

Removes `dodge` from `STUB_TOOLS`.

Branched from `main` (independent).

Test plan

  • Press O — dodge tool active, options bar shows stroke width + dodge hint.
  • Drag across the image — area visibly brightens (default 30 % layer opacity).
  • Adjust the new layer's opacity in the right panel — dodge gets stronger / weaker.
  • Repeat strokes — brightness builds up.
  • Cmd+Z undoes; Cmd+Shift+Z redoes.
  • Save .json project, reload — dodge stroke persists with mode preserved.
  • Export PNG — dodge baked at source resolution.

🤖 Generated with Claude Code

…ixels

Promotes the Dodge (O) tool from stub to functional. Drag on the canvas
to paint a stroke that brightens the pixels underneath, same idea as
PS's Dodge: each layer represents one stroke, layer opacity controls
intensity, and repeated strokes build up.

## Implementation

- \`BrushShape\` gains an optional \`mode: 'dodge' | 'burn'\` field. When
  set, \`drawBrush\` overrides the stroke color (white for dodge, black
  for burn) and the composite operation ('lighter' / 'multiply'). The
  per-layer save/restore around \`drawShape\` already isolates these
  changes from siblings, so no extra cleanup is needed.
- \`Canvas.tsx\` adds a tool-'dodge' branch that creates a brush layer
  with \`mode: 'dodge'\`, default opacity 30 so a single stroke gives a
  soft brighten — repeat to build up.
- \`OptionsBar\` shares the brush variant (stroke width slider) and adds
  a dodge-specific hint.
- \`LayersPanel\` labels dodge/burn brushes distinctly so the layer list
  reads cleanly.
- The 'burn' mode is wired in the data model + drawing path + label
  table but no UI tool selects it yet — folded in so a future Burn-tool
  PR is a one-line palette change.

Removes \`dodge\` from \`STUB_TOOLS\`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@lyfuci lyfuci merged commit 21cce55 into main Apr 24, 2026
2 checks passed
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