Commit Graph
513 Commits
Author SHA1 Message Date
Sanghyeon LeeandGitHub 763735ac84 Add SCENE_INIT broadcast type for new user (#1095) 2020-03-28 19:35:56 -07:00
Christopher ChedeauandGitHub 8e6d55cf75 Fix corner resize for multi-point arrows (#1105)
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
2020-03-28 18:08:21 -07:00
Christopher ChedeauandGitHub 24fa657093 Don't reset cache while zooming using a gesture (#1103)
* 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
2020-03-28 16:59:36 -07:00
Kent BeckandGitHub 95eaadeb85 Refactor paste code (#1102) 2020-03-28 15:43:09 -07:00
Christopher ChedeauandGitHub 6056170d4b Fix wysiwyg center (#1101)
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
2020-03-28 14:30:41 -07:00
Kent BeckandGitHub aa54364bd6 Use existing helper to copy all state (#1098) 2020-03-27 15:18:14 -07:00
David LuzarandGitHub cac2dda5ac Add loading state (#1027)
* add loading state

* update snapshots

* add border radius

* fix comment breaking build jsx
2020-03-26 18:28:26 +01:00
David LuzarandGitHub 6fd2a3b2e5 fix z-index action to account for deleted elems and add tests (#1077) 2020-03-26 00:28:50 -07:00
Sanghyeon LeeandGitHub 051a946438 Add Enter key handler that can start text editing (#1084)
* Add handler that can start text editing with Enter key

* Refine `startTextEditing` parameters

* Apply prettier fixes
2020-03-25 17:12:51 +01:00
David LuzarandGitHub 42df058223 load from localStorage only if not in multiplayer (#1074) 2020-03-24 09:57:59 -07:00
Sanghyeon LeeandGitHub 104e48b6cb Add the shape lock button for mobile (#1054) 2020-03-24 12:51:49 +02:00
dependabot-preview[bot]GitHubdependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>Panayiotis Lipiridis
722c498abe Bump prettier from 1.19.1 to 2.0.1 (#1060)
* Bump prettier from 1.19.1 to 2.0.1

Bumps [prettier](https://github.com/prettier/prettier) from 1.19.1 to 2.0.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/1.19.1...2.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Update formatting

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Panayiotis Lipiridis <lipiridis@gmail.com>
2020-03-23 13:05:07 +02:00
f1160a1534 load scene from localStorage in collaboration if user is first… (#1036)
* load scene from localStorage in collaboration if user is first in room

* load scene from localStorage in collaboration prior to syncing with server

* fix merge

Co-authored-by: dwelle <luzar.david@gmail.com>
2020-03-22 18:41:05 +01:00
Kent BeckandGitHub ba3cec8d0d App mitosis begins (#1047) 2020-03-22 18:24:50 +01:00
Kent BeckandGitHub d3d25a128c Extract helper for App context menu handling (#1033)
* Encapsulate SceneHistory. A little.

* Clean up TopErrorBoundary

* Extract helper for App context menu handling
2020-03-21 17:03:17 +01:00
David LuzarandGitHub f6b36519f1 don't pass deleted elements to UI (#1029) 2020-03-20 21:46:09 +01:00
Kent BeckandGitHub dc618ab122 Encapsulate SceneHistory. A little. (#1016) 2020-03-20 18:45:30 +01:00
David LuzarandGitHub edd54d93b3 revert #1017 (#1025)
This reverts commit 1546c00c0c.
2020-03-20 16:46:06 +01:00
Chang YanandGitHub 1546c00c0c Fix adding incorrect dragging element when handleCanvasPointerD… (#1017) 2020-03-20 11:00:50 +01:00
David LuzarandGitHub fda06e4fc3 Fix history - the 2nd installment (#1014)
* don't regenerate versionNonce on pushEntry

* fix history handling around multi-point arrows

* remove filtering from getElementMap helper
2020-03-19 11:41:32 -07:00
Faustino KialungilaandGitHub f14aaccc38 Fix SpaceBar pan (#1013) 2020-03-19 08:59:20 -07:00
David LuzarandGitHub 82ce068972 fix history (#1009)
* fix history

* tweak withBatchedUpdates typing
2020-03-19 14:51:05 +01:00
David LuzarandGitHub ff033640e4 expose a few state props for debugging (#1008)
* expose a few state props for debugging

* rename h.appState & add h.setState

* support setting elements
2020-03-18 20:44:05 +01:00
cb66adc716 Add a Shortcut for Toggling Shape Lock (#1005)
* Update shortcuts.md for Lock

* Add 'Q' as a shortcut for toggling shape lock

* Add shortcut to LockIcon title

* use event.key instead

Co-authored-by: Faustino Kialungila <Faustino.kialungila@gmail.com>
2020-03-18 19:29:59 +01:00
David LuzarandGitHub b7da524538 confirm arrow on doubleclick (#949)
* confirm arrow on double click

* change hint

* fix cursor not updating on click
2020-03-18 16:43:06 +01:00
David LuzarandGitHub 254a0753ff fix negative resize for non-multipoint elements (#1000) 2020-03-18 08:34:04 -07:00
Chang YanandGitHub 6fe40516bf deselect all elements when inserting text with double click (#996) 2020-03-17 23:11:27 -07:00
Pete HuntandGitHub 7d57d124bd Fix alt drag (#995) 2020-03-17 15:21:35 -07:00
David LuzarandGitHub 373d16abe6 improve & granularize ExcalidrawElement types (#991)
* improve & granularize ExcalidrawElement types

* fix incorrectly passing type

* fix tests

* fix more tests

* fix unnecessary spreads & refactor

* add comments
2020-03-17 20:55:40 +01:00
Pete HuntandGitHub b603337c3f Fix multielements (#987) 2020-03-17 11:01:11 -07:00
Christopher ChedeauandGitHub 0dc07135b7 Fix three rendering when loading (#986)
The problem is that syncActionResult wasn't using batching.
2020-03-16 19:21:01 -07:00
Pete HuntandGitHub e9f5175f51 Fix performance bug (#984) 2020-03-16 19:07:47 -07:00
Christopher ChedeauandGitHub db1f97f59e Revert "[RFC] Randomized names next to mouse pointers. (#971)" (#972)
This reverts commit dcb93f75e6.
2020-03-16 00:38:37 -07:00
dcb93f75e6 [RFC] Randomized names next to mouse pointers. (#971)
* [WIP] Add names next to pointers

This implements the rendering and messaging across. Still need to do the UI to set the name.

Also, not really sure what's the best place to send the name and store it.

* Add randomized names

Co-authored-by: Christopher Chedeau <vjeux@fb.com>
2020-03-15 18:56:38 -07:00
Keyan ZhangandGitHub d58216f5ec [RFC] show confirmation dialog before the user closes the page (#957) 2020-03-15 14:00:33 -07:00
Christopher ChedeauandGitHub 2937efacde Remove last get/setTransform (#964)
My original hack to put the scale when we create the canvas element doesn't make much sense. It should be done when we are rendering the scene. I moved it there in this PR.

The rest was all about forwarding the scale to where it's needed.
2020-03-15 12:25:18 -07:00
Pete HuntandGitHub 35ce1729cc remove most setState({}) (#959) 2020-03-15 10:06:41 -07:00
Pete HuntandGitHub e1e2249f57 Abstract away or eliminate most of the mutation of the Elements array (#955) 2020-03-14 21:48:51 -07:00
Pete HuntandGitHub 3f8144ef85 Fix many syncing issues (#952) 2020-03-14 20:46:57 -07:00
Christopher ChedeauandGitHub b20d4539c0 Stop using getTransform (#950)
* Stop using getTransform

Fixes #861

The original motivation behind this is to make it work with Firefox. But it also helped make the code more intentional.

Test Plan:
- Create one square, select it, zoom in repeatedly, make sure that it zooms centered in the screen and everything looks good
- Scroll at various zoom levels, things look good
- Export a small scene at 1x and 3x, make sure the background is properly set and look good

* fix selection element
2020-03-14 17:24:28 -07:00
dbfc8bee57 Add copy to PNG option on context menu (#941)
* Add copy to PNG option on context menu

* lint & refactor & fixes

* add keybinding

* swap keybinding

* fix docs

Co-authored-by: dwelle <luzar.david@gmail.com>
2020-03-14 22:53:18 +01:00
David LuzarandGitHub b9c75b5bc4 use deletedIds map to sync deletions (#936)
* use deletedIds map for sync deletions

* refactor how we create data for syncing

* fix comments

* streamline broadcast API

* split broadcast methods
2020-03-14 21:25:07 +01:00
David LuzarandGitHub 450a024f5c remove object.fromEntries (#933) 2020-03-13 15:10:24 +01:00
dwelle 642e47bd03 Merge remote-tracking branch 'origin/master' into fix_multiplayer_concurrency 2020-03-12 21:49:54 +01:00
dwelle c04fe403fc don't sync editing elements & prefer local versions 2020-03-12 21:28:58 +01:00
Edwin LinandGitHub 37284c9174 Merge pull request #915 from excalidraw/fix_remote_pointers
remove remote pointers on client disconnect
2020-03-12 12:18:27 -07:00
David LuzarandGitHub 95e726bd6f cancel text via doubleclick when in multiElement mode (#926) 2020-03-12 18:31:53 +01:00
dwelle 5706dd7ae2 consolidate & align collaboration socket eventing with server 2020-03-12 12:19:56 +01:00
dwelle 96320478e6 remove remote pointers on client disconnect 2020-03-12 10:41:36 +01:00
David LuzarandGitHub 2db2f3f5e4 Collab ui tweaks (#913)
* decrease gap between menu icons

* reduce margin of copy button

* add collaboratorsCount to roomDialog toggle button
2020-03-11 14:48:27 -07:00