* Add RTL styles. Most of the work is done by the browser 💖
* Refactor getLanguage
* Additional fixes
* Mirror the mouse pointer icon
* Move the vertical scrollbar to the left on RTL
* Revert "Mirror the mouse pointer icon"
This reverts commit f69b132538038d231b1b1acc0d6f4a28c91130bb.
* rotate rectanble with fixed angle
* rotate dashed rectangle with fixed angle
* fix rotate handler rect
* fix canvas size with rotation
* angle in element base
* fix bug in calculating canvas size
* trial only for rectangle
* hitTest for rectangle rotation
* properly resize rotated rectangle
* fix canvas size calculation
* giving up... workaround for now
* **experimental** handler to rotate rectangle
* remove rotation on copy for debugging
* update snapshots
* better rotation handler with atan2
* rotate when drawImage
* add rotation handler
* hitTest for any shapes
* fix hitTest for curved lines
* rotate text element
* rotation locking
* hint messaage for rotating
* show proper handlers on mobile (a workaround, there should be a better way)
* refactor hitTest
* support exporting png
* support exporting svg
* fix rotating curved line
* refactor drawElementFromCanvas with getElementAbsoluteCoords
* fix export png and svg
* adjust resize positions for lines (N, E, S, W)
* do not make handlers big on mobile
* Update src/locales/en.json
Alright!
Co-Authored-By: Lipis <lipiridis@gmail.com>
* do not show rotation/resizing hints on mobile
* proper calculation for N and W positions
* simplify calculation
* use "rotation" as property name for clarification (may increase bundle size)
* update snapshots excluding rotation handle
* refactor with adjustPositionWithRotation
* refactor with adjustXYWithRotation
* forgot to rename rotation
* rename internal function
* initialize element angle on restore
* rotate wysiwyg editor
* fix shift-rotate around 270deg
* improve rotation locking
* refactor adjustXYWithRotation
* avoid rotation degree becomes >=360
* refactor with generateHandler
Co-authored-by: Lipis <lipiridis@gmail.com>
Co-authored-by: dwelle <luzar.david@gmail.com>
* Add a icon for dulplication
* Add PanelComponent for duplication
* Add duplicate button for mobile
* Add styles for layout action buttons
* Add a translation for 'Actions'
* Show left action buttons only for desktop
* Add duplicate button at the bottom of mobile
It is provided depending on whether or not it is `multiElement` to maintain space between buttons.
Fixes#1115
The issue is that replaceAllElements calls a render synchronously, preventing lastBroadcastedOrReceivedSceneVersion from being set correctly.
I tried using batchUpdate but it only takes a single argument ( c5d2fc7127/packages/react-reconciler/src/ReactFiberWorkLoop.js (L1088) ) whereas the callback takes two.
Test Plan:
- Add a console.log before `this.broadcastScene("SCENE_UPDATE");` in App.tsx
- Connect a bunch of clients
- Have one move a shape
- Make sure that this client has the console logged
- Make sure the other clients don't have it
The logic to support it was not implemented. This is not the prettiest way to solve it in the world but it does work. Some more refactoring here is probably warranted.
Fixes#1039
* Don't reset cache while zooming using a gesture
This reuses the cached canvas while the gesture is happening. Once it has stop updating, then recompute the cache with the proper zoom.
This should massively improve performance when panning on big scenes on mobile
Fixes#1056
* update snapshot tests
This wasn't taking into account zoom properly.
The logic should probably get refactored a bit, it's not ideal that we're passing canvas, state and scale as different arguments. Also it's weird that the function that returns the center is computing the viewport translation. But I'm not motivated enough to fix it right now...
Fixes#1100