27 Commits

Author SHA1 Message Date
Christopher Chedeau
7f6e1f420e
Pure node rendering (#443) 2020-01-19 13:21:33 -08:00
Mike Lewis
5ce5e5ac1e Adjust type of data URI when saving (#452)
Previously the type used for the data URI when saving was text/plain.
On iPad, this caused the file to automatically have a .txt extension
added (so files ended up with names like "drawing-xyz.json.txt"). This
meant that the files couldn't be loaded by the tool, which expects only
files with a .json extension.

Now, the type used is application/json, which means that the files get
saved with the correct extension and can be successfully loaded on iPad.
2020-01-19 23:15:40 +02:00
David Luzar
6892348c3d Revert 400 and 420 (#422)
* revert #400 font file

* Revert "Revert "Set scale for export images (#416)" (#420)"

This reverts commit d603921234b9ae1483f9f0e0f79fb1c3d0878370.
2020-01-17 16:43:24 +02:00
Timur Khazamov
d603921234
Revert "Set scale for export images (#416)" (#420)
This reverts commit 82f559f826f4ab0504981a281335e0a25d332a6a.
2020-01-17 15:55:17 +03:00
Timur Khazamov
82f559f826
Set scale for export images (#416) 2020-01-17 15:19:56 +03:00
Thomas Steiner
7ddc206b8c
Add Native File System API saving/exporting and opening (#388)
* Add Native File System API saving/exporting

* Add Native File System API opening

* Add origin trial token placeholder

* Reuse an opened file handle for better saving experience

* Fix file handle reuse to only kick in for Excalidraw files

* Remove reference
2020-01-17 11:25:05 +01:00
Brady Madden
a3aa57d98b
Add AppState to export json to fix various import bugs (#358)
* export background, app state

* review comments
2020-01-15 21:08:52 -05:00
Bakhtiiar Muzakparov
8db8827c6f feat: add line shape (#371)
* feat: add line shape

* fix: align line tool

* fix: hitbox bug sw to ne

* fix: add stroke width n sloppiness  for line

* fix: center line inside a panel box

* fix: use color as a unique key
2020-01-16 00:07:19 +05:00
Timur Khazamov
79aee53ff6 Redesign idea (#343)
* Redisign idea

* Code cleanup

* Fixed to right container

* Reoredered layout

* Reordering panels

* Export dialog

* Removed redunant code

* Fixed not removing temp canvas

* Fixed preview not using only selected elements

* Returned file name on export

* Toggle export selected/all elements

* Hide copy to clipboard button if no support of clipboard

* Added border to swatches

* Fixed modal flickering
2020-01-15 07:42:02 -08:00
Preet
8dbd1b80df Update to rough.js 4.0.1 (#363)
* upgrade to latest rough.js

* remove random.ts because roughjs now supports seeding.
2020-01-13 11:04:28 -08:00
Timur Khazamov
bc2bae2a9a Shift drag to add to selection (#355)
* Shift drag to add to selection

* Inlined variable
2020-01-12 15:32:25 -08:00
Christopher Chedeau
f91b708abb
Revert "Shift drag to add to selection (#350)" (#352)
This reverts commit ce467f7b6572615c5f4050f3e514943867b6fb9d.
2020-01-12 12:08:18 -08:00
Timur Khazamov
ce467f7b65 Shift drag to add to selection (#350) 2020-01-12 11:56:10 -08:00
Gasim Gasimzada
ba8bc10431 Remove element shape object from local storage save (#336) 2020-01-12 15:08:47 +05:00
Gasim Gasimzada
74764b06eb Regenerate roughjs shape only when the item is updated (#316)
* Regenerate roughjs shape only when the item is updated

* Remove shape object during export and history undo/redo

* Remove shape element during copying

* Fix shape generation during creation
2020-01-11 16:00:00 -08:00
David Luzar
deee57314d
support export canvas to clipboard (#232) 2020-01-09 17:37:08 +01:00
Gasim Gasimzada
862231da4f Make all operations on elements array immutable (#283)
* Make scene functions return array instead of mutate array

- Not all functions were changes; so the given argument was a new array to some

* Make data restoration functions immutable

- Make mutations in App component

* Make history actions immutable

* Fix an issue in change property that was causing elements to be removed

* mark elements params as readonly & remove unnecessary copying

* Make `clearSelection` return a new array

* Perform Id comparisons instead of reference comparisons in onDoubleClick

* Allow deselecting items with SHIFT key

- Refactor hit detection code

* Fix a bug in element selection and revert drag functionality

Co-authored-by: David Luzar <luzar.david@gmail.com>
2020-01-09 16:22:04 +01:00
Faustino Kialungila
1ea72e9134
Center element on paste (#248)
* Center element on paste

* paste on cursor position

* correctly center elements

* rename vars
2020-01-09 12:34:46 +01:00
Guillermo Peralta Scura
4a044d3ace Show move and resize cursors on hover (#280)
* Change to move cursor on hover

* Show resize handlers on hover
2020-01-08 18:56:35 -08:00
davidbonan
a16cd3a34f Add font size and font familly option for selection (#278)
* Add font size and font familly option for selection

* Allow copy font style

* More clearner method name

* Update options size and font-familly
2020-01-08 17:29:41 -08:00
Timur Khazamov
1739540f00
Creating a text near the center of a shape should put it in the center (#270)
* Snap to element center

* Fixed typo

* Added comment

* Reduced threshold to 30

* Skip snapping if alt key is pressed

* Fixed creating text with shape tool
2020-01-09 01:09:09 +05:00
Gasim Gasimzada
4b7eb2f04a
Add IDs to elements (#236)
* Add IDs to elements

- Move round rect function within the renderer

* Generate IDs using nanoid

* If element ID does not exist, add the ID during restoration
2020-01-07 23:49:39 +04:00
Timur Khazamov
ae982e9298 Revert "Save scene in URL (#220)" (#234)
This reverts commit db973c61e85347120c46adba6cb33e50d49988ba.
2020-01-07 07:18:20 -08:00
Gasim Gasimzada
829a65b8cb
Refactor Element Functions (#233)
* Remove `generatedraw` from element object

- Create a function that renders a single element
- Refactor rendering selected elements

* Replace getElementAbsoluteXY with getElementAbsoluteCoords
2020-01-07 19:04:52 +04:00
Timur Khazamov
db973c61e8 Save scene in URL (#220)
Co-authored-by: Christopher Chedeau <vjeuxx@gmail.com>
2020-01-06 19:08:23 -08:00
Gasim Gasimzada
86a1c29eec
Extract scene functions to their respective modules (#208)
- Also, extract utilities into utils module -- capitalizeString, getDateTime, isInputLike
2020-01-06 20:24:54 +04:00
Gasim Gasimzada
01805f734d
Extract element functions into modules (#207) 2020-01-06 19:34:22 +04:00