* 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>
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
* Fix hit testing threshold
- The bounding box was not correctly extended to take into account the threshold. It was only for y axis but not x.
- The bezier threshold was using 20 instead of 10 and not taking into account zoom level.
Both those issues are fixed and now the behavior looks good on all the shapes I can test.
* fix_tests
* Get rid of isSelected, canvas, canvasZoom, canvasOffsetX and canvasOffsetY on ExcalidrawElement.
* Fix most unit tests. Fix cmd a. Fix alt drag
* Focus on paste
* shift select should include previously selected items
* Fix last test
* Move this.shape out of ExcalidrawElement and into a WeakMap
* Initial factoring out of parts of the LayerUI component
2360 → 2224 LOC
* Create a Section component
* Break up src/index.tsx
* Refactor actions to reduce duplication, fix CSS
Also consolidate icons
* Move scene/data.ts to its own directory
* Fix accidental reverts, banish further single-character variables
* ACTIVE_ELEM_COLOR → ACTIVE_ELEMENT_COLOR
* Further refactoring the icons file
* Log all errors
* Pointer Event polyfill to make the tests work
* add test hooks & fix tests
Co-authored-by: dwelle <luzar.david@gmail.com>
* Make Undo & Redo and the menu buttons into actions; add undo/redo buttons
* Create variables for the ToolIcon colors
* Darken the menu buttons when they’re active
* Put the more intensive test in `perform`
* Fix & restyle hint viewer
* Add pinch zoom for macOS Safari
* Chrome/Firefox trackpad pinch zoom
* openedMenu → openMenu
* needsShapeEditor.ts → showSelectedShapeActions.ts
* Call showSelectedShapeActions
* Disable text selection
* Set content-editable=plaintext-only to disable Touch Bar formatting buttons
* Enlarge resize handle tap targets for pen/touch
* Make the lock button a button in mobile mode
* Use icons instead of Unicode characters; add an alternate toolbar for creating multipoint lines
* Allow buttons to hide themselves
* Fix heuristic for showing shape actions
* Refactor icons
* Fix label for edit button
* Switch edit button icon
* Remove lock button on mobile
* Add language selector on mobile
* Fix showing edit button on mobile
* Fix showing edit button on mobile, part 2
* Fix handle touch regions
* Fix scroll-back button position
* Allow using the text tool on a text object to start editing it
* Fix deletion of last point in line
* Zoom icons.
* Actions.
* Min zoom of 0 does not make sense.
* Zoom logic.
* Modify how zoom affects selection rendering.
* More precise scrollbar dimensions.
* Adjust elements visibility and scrollbars.
* Normalized canvas width and height.
* Apply zoom to resize test.
* [WIP] Zoom using canvas center as an origin.
* Undo zoom on `getScrollBars`.
* WIP: center zoom origin via scroll
* This was wrong for sure.
* Finish scaling using center as origin.
* Almost there.
* Scroll offset should be not part of zoom transforms.
* Better naming.
* Wheel movement should be the same no matter the zoom level.
* Panning movement should be the same no matter the zoom level.
* Fix elements pasting.
* Fix text WYSIWGT.
* Fix scrollbars and visibility.
* switch to selection tool on paste
* align pasting via contextMenu with pasting from event
* ensure only plaintext can be pasted
* fix findShapeByKey regression
* simplify wysiwyg pasting
* improve wysiwyg blurriness
* Separate UI from Canvas
* Explicitly define history recording
* ActionManager: Set syncActionState during construction instead of in every call
* Add commit to history flag to necessary actions
* Disable undoing during multiElement
* Write custom equality function for UI component to render it only when specific props and elements change
* Remove stale comments about history skipping
* Stop undo/redoing when in resizing element mode
* wip
* correctly reset resizingElement & add undo check
* Separate selection element from the rest of the array and stop redrawing the UI when dragging the selection
* Remove selectionElement from local storage
* Remove unnecessary readonly type casting in actionFinalize
* Fix undo / redo for multi points
* Fix an issue that did not update history when elements were locked
* Disable committing to history for noops
- deleteSelected without deleting anything
- Basic selection
* Use generateEntry only inside history and pass elements and appstate to history
* Update component after every history resume
* Remove last item from the history only if in multi mode
* Resume recording when element type is not selection
* ensure we prevent hotkeys only on writable elements
* Remove selection clearing from history
* Remove one point arrows as they are invisibly small
* Remove shape of elements from local storage
* Fix removing invisible element from the array
* add missing history resuming cases & simplify slice
* fix lint
* don't regenerate elements if no elements deselected
* regenerate elements array on selection
* reset state.selectionElement unconditionally
* Use getter instead of passing appState and scene data through functions to actions
* fix import
Co-authored-by: David Luzar <luzar.david@gmail.com>
* Enable multi points in lines
* Stop retrieving arrow points for lines
* Migrate lines to new spec during load
* Clean up and refactor some code
- Normalize shape dimensions during load
- Rename getArrowAbsoluteBounds
* Fix linter issues
* Revert "Revert "Feature: Multi Point Arrows (#338)" (#634)"
This reverts commit 3d2e59bfed4fa41a0cae49ee567a6f95ca26e7bf.
* Convert old arrow spec to new one
* Remove unnecessary failchecks and fix context transform issue in retina displays
* Remove old points failcheck from getArrowAbsoluteBounds
* Remove all failchecks for old arrow
* remove the rest of unnecessary checks
* Set default values for the arrow during import
* Add translations
* fix restore using unmigrated elements for state computation
* don't use width/height when migrating from new arrow spec
Co-authored-by: David Luzar <luzar.david@gmail.com>
Co-authored-by: Christopher Chedeau <vjeuxx@gmail.com>
Turns out the root cause was the outline. For some reason, doing "transparent" doesn't work but doing "1px solid transparent" does. Don't know why but I'll take it!
There's a bug where the carret doesn't show up when the text is first focused on Chrome with the previous combination of CSS. I tweaked it and now it seems to work (don't ask me why!).
Unfortunately on Safari, ever since we moved to contentEditable on #274, the carret disappeared the first time. I unsuccessfully tried to repro in a smaller codebase ( https://jsfiddle.net/u2mjs90y/1/ ) but it does work in Safari...
I'm not exactly sure what's going on, there are bunch of issues opened against this bug when googling against all the browsers...