* implement line editing
* line editing with rotation
* ensure adding new points is disabled on point dragging
* fix hotkey replacement
* don't paint bounding box when creating new multipoint
* tweak points style, account for zoom and z-index
* don't persist editingLinearElement to localStorage
* don't mutate on noop points updates
* account for rotation when adding new point
* ensure clicking on points doesn't deselect element
* tweak history handling around editingline element
* update snapshots
* refactor pointerMove handling
* factor out point dragging
* factor out pointerDown
* improve positioning with rotation
* revert to use roughjs for calculating points bounds
* migrate from storing editingLinearElement.element to id
* make GlobalScene.getElement into O(1)
* use Alt for adding new points
* fix adding and deleting a point with rotation
* disable resize handlers & bounding box on line edit
Co-authored-by: daishi <daishi@axlight.com>
* don't use unicode characters for shortcut help
* use option instead of alt
* make shortcut replacement case-insensitive
* improve shortcut dialog layout
Following #1478, a bug was found related to transparent backgrounds. As Excalidraw only supports `transparent` as a valid transparent color, this commits generalizes the use of canvas to normalize color values.
It changes a few details:
- `rgba()` or `hsla()` syntaxes are not accepted anymore
- pasting values goes through the same normalization step, avoiding invalid values
- color validation is not regex-based anymore
- any CSS-valid black color is now accepted (e.g. previously, `rgb(0,0,0)` was rejected)
* add hint & support multi-line hints
* resize from center point using the new resize maths
* resize with origin element when lifting alt key
* add readonly to elementOriginPosition
* add setResizeWithCenterKeyLifted
* isResizeFromCenter logic
* offsetX and offsetY
* simplify equations
* creating element from center point
* lint
* lint
* lint
* remove revert on key up logic
Co-authored-by: dwelle <luzar.david@gmail.com>
Co-authored-by: daishi <daishi@axlight.com>
* add zoom center action button
* enhance zoom calculation and scroll to center
* add zoom out and center button
* filter deleted elements
* improve complexity
* add key shortcut
* calculate zoom value
* don't render zoomCenter action
* offset from top to account for shape menu
* change shortcut & add to shortcut dialog
* decrease offset
* revert offset
* change hotkey & description
* rename to zoomToFit
* change shortcut label & position
Co-authored-by: dwelle <luzar.david@gmail.com>
* improvement(layerui.js): add lock icon on top right to show encrypted info about excalidraw
fixes https://github.com/excalidraw/excalidraw/issues/1313
* swap lock with shield
* fix dimensions
* make link open in new tab
* add newline between toolip text and link
* increase tooltip line-height
* remove unused GitHubCorner compo
* reposition; reintroduce GH icon
* make shield into link
* make tooltip not show when drawing
* Review fix
* remove link from tooltip
Co-authored-by: dwelle <luzar.david@gmail.com>
* chore(gitignore): add .idea to gitignore
* refactor(layerui): pass named function to react.memo so that in dev tools the name shows up
This makes debugging easier as well
* refactor(layerui): break the functional component into multiple render methods
* Add variable for island color
* Make islands semi-transparent
This preserves the notion of the infinite canvas and helps
maintain context, especially on smaller screens.