feat(image-editor): wire Marquee + Burn + Rotate View#43
Merged
Conversation
Three more PS-staple tools moved out of the stub bucket. Bundled together because they're independent additions that don't conflict. ## Marquee (M) Adds a real marquee selection. Drag-to-define a rectangular selection; the selection persists in `EditorState.selection` (history-tracked, .json round-trip), shown as a static marching-ants outline (white dashes over black halo). Cmd/Ctrl+A select all (full canvas), Cmd/Ctrl+D deselect. - New `Interaction` kind in Canvas: `marquee-drawing` (mousedown → start; mousemove → update; mouseup commits via `onCommitSelection` if the drag is non-trivial). Live preview rendered after `renderTo` so it sits above all other content. - `EditorState.selection` lives in original-image preview-pixel space; parent shifts cropped-canvas coords back by the active crop origin before storing. - `render.ts` gains a `liveCanvas` flag (true on the live preview, false on export) — gates marching-ants chrome so it never bakes into pixels. - `OptionsBar` marquee variant: hint text + "Deselect" button when a selection is active. - `serialize.ts` adds `selection` to the parsed state. ## Burn Mirror of Dodge from PR #42. New `'burn'` value in the `Tool` union; `Canvas.tsx`'s dodge branch now handles dodge OR burn (white+lighter vs. black+multiply). Palette gets a Moon icon next to the dodge Sun. `OptionsBar` shares the brush variant with a burn-specific hint. Layer-list label distinguishes burn strokes. ## Rotate View (R) View-only canvas rotation. New `viewRotation` state (0/90/180/270) in ImageEditor; Workspace applies it as a CSS `rotate()` on the wrapper transform. Pixels are not modified — purely a viewing aid. Toggled by the R keyboard shortcut OR by clicking the palette button (intercepted in `trySetTool` since rotateView has no "tool mode" — every click just cycles the rotation). `STUB_TOOLS` shrinks: `marquee` and `rotateView` removed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three more PS-staple tools moved from stubs to functional. Bundled together because they're independent additions — no overlap in concerns or shared files beyond the usual i18n / palette / options-bar plumbing.
Marquee (M)
Real rectangular selection. Drag to define; selection persists in
`EditorState.selection` (history-tracked + .json round-trip); shown as
a static marching-ants outline (white dashes over a black halo for
legibility on any background). Cmd/Ctrl+A selects all,
Cmd/Ctrl+D deselects.
cropped-canvas coords back by the active crop origin before storing.
export) — gates marching-ants chrome so it never bakes into pixels.
selection is active.
Burn
Mirror of Dodge (#42). New `'burn'` in the `Tool` union; the dodge
branch now handles both (white+`lighter` vs. black+`multiply`).
Palette gets a Moon icon next to the dodge Sun. Layer-list distinguishes
burn strokes.
Rotate View (R)
View-only canvas rotation. New `viewRotation` state (0/90/180/270) in
ImageEditor; Workspace applies it as a CSS `rotate()` on the wrapper
transform. Pixels untouched. Toggled by R OR by clicking the
palette button (intercepted in `trySetTool` since rotateView has no
"tool mode" — every click just cycles the rotation).
`STUB_TOOLS` shrinks: `marquee` and `rotateView` removed.
Test plan
🤖 Generated with Claude Code