Add free drawing mode for freehand canvas input#346
Open
olavl wants to merge 1 commit intojeffeb3:masterfrom
Open
Add free drawing mode for freehand canvas input#346olavl wants to merge 1 commit intojeffeb3:masterfrom
olavl wants to merge 1 commit intojeffeb3:masterfrom
Conversation
Allow users to draw directly on the preview canvas with mouse or touch. A pencil toggle button activates draw mode; mouse-up finalizes the stroke as a new Drawing layer with Douglas-Peucker simplification and Chaikin corner-cutting smoothing. Layers support free scaling and all existing transforms/effects. Co-Authored-By: Claude Opus 4.6 <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
How it works
Files changed
src/features/shapes/Drawing.js— new shape type with Douglas-Peucker + Chaikin smoothingsrc/features/shapes/shapeFactory.js— register Drawing shapesrc/features/preview/previewSlice.js— drawing mode state and actionssrc/features/preview/previewSlice.spec.js— updated test for new initial statesrc/features/preview/PreviewWindow.js— mouse/touch event handling and live stroke previewsrc/features/preview/PreviewManager.js— draw toggle button and Escape key handlingTest plan
npm test— all 125 tests passvite build— production build succeeds🤖 Generated with Claude Code