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

This reverts commit 2b6d1470f936bfae113fc4765988b20e7db35bbb.
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

View File

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