feat(paint-editor): allow zoom while drawing - #857
Conversation
Enabling `enableZoomWhileDrawing` keeps the viewer's gesture detector alive while a drawing tool is active, so it reported every one-finger drag as a zoom interaction: each stroke fired `onEditorZoomScaleStart/Update/End` and rebuilt the whole paint editor twice. Only gestures the viewer can act on (pan enabled, or a real multi-finger pinch) are forwarded now; a pinch that starts as a stroke reports the start it would otherwise have missed. Also drop the stroke when an auxiliary mouse button is pressed mid-drag. Button changes arrive as move events on the same pointer, so the stroke was only paused and resumed with a straight jump once the button was released. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Thanks for this — really nice feature, and the write-up made the review easy. Merging with two small follow-up fixes pushed onto the branch: 1. Strokes were reported as zoom interactions. Keeping 2. An auxiliary button pressed mid-stroke left a gap in the path. Pressing right/middle while already drawing arrives as a move event on the same pointer, not as a new one, so the stroke was only paused and then resumed with a straight jump once the button was released. It is discarded now, like every other navigation interrupt. Added regression tests for both, plus the CHANGELOG entry and the version bump to 13.4.0. Thanks again! |
…re latch Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Super glad you found it useful! Thank you Alex. Yes, it is a huge UX experience in my opinion. Will try again after your fixes , I did not notice those but sounds better now! |
Description
Hello,
This PR is to allow navigating the paint editor while a drawing tool is active. This has been AI-assisted, but I tested myself.
Pinch, trackpad, and mouse-wheel still move the view; primary click-drag still draws. Secondary and middle mouse buttons pan, matching the main editor. An in-progress stroke is discarded if the view moves so path coordinates stay in one transform space.
Disable with
PaintEditorConfigs.enableZoomWhileDrawing: false(also restores every mouse button drawing).By default, the library behaves like it was before this PR. Flag needs to be set to true to benefit from this.
Implementation:
Type of Change