Panning, modeChange Event, minor changes #939
Merged
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.
-- prDefault for pressing on
mouse wheel
to avoid firing of default browser's (e.g. Chrome) panning-- quick access to the select mode while panning mode is active with dbClick. Also, the panning mode is active while holding
Space/mousewheel
- once they're released the mode changes back to the previous one. This allows a quicker use of both Select and Panning tools without a need to click them on the left panel.-- new custom event was added in svgcanvas that fires on every setMode(). For now, the event helps to track the active mode to set cursor styling (atm only zoom, panning, and select tools have their own cursors, but I would like to add it for other tools for better UX). Also, this event can have different implementations in the future.
-- prDefault for
Ctrl+wheel
- I've added it based on my own experience because I always try to scale the canvas with this shortcut (instead ofShift+wheel
), but it scales the whole page instead. Having this behavior here seems unnecessary, perhaps it would be better to allow this shortcut to scale the canvas as well in the future. 👀--
Ctrl
was added to the Undo/Redo shortcuts because theZ
shortcut was already assigned for the Zoom tool.