Revert "Remove native gesture "support" from iOS (#2457)" (#2483)

This reverts commit 2b6d1470f9.
This commit is contained in:
David Luzar 2020-12-07 19:22:20 +01:00 committed by GitHub
parent 5e57f408c5
commit 3be5038c14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

View File

@ -1407,14 +1407,30 @@ class App extends React.Component<ExcalidrawProps, AppState> {
private onGestureStart = withBatchedUpdates((event: GestureEvent) => {
event.preventDefault();
this.setState({
selectedElementIds: {},
});
gesture.initialScale = this.state.zoom.value;
});
private onGestureChange = withBatchedUpdates((event: GestureEvent) => {
event.preventDefault();
this.setState(({ zoom }) => ({
zoom: getNewZoom(
getNormalizedZoom(gesture.initialScale! * event.scale),
zoom,
{ x: cursorX, y: cursorY },
),
}));
});
private onGestureEnd = withBatchedUpdates((event: GestureEvent) => {
event.preventDefault();
this.setState({
previousSelectedElementIds: {},
selectedElementIds: this.state.previousSelectedElementIds,
});
gesture.initialScale = null;
});
private handleTextWysiwyg(