mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
Remove native gesture "support" from iOS (#2457)
We were processing both the touch move and gesture on iOS which was first firing twice as many set state, but also caused issues: - The gesture implementation didn't support zooming on the center - Touching down on a circle and then on the bottom chrome would freak out because initialScale was null Touching down on the menu still isn't perfect as it shifts the shape around but doesn't completly break the zoom
This commit is contained in:
parent
545b214558
commit
2b6d1470f9
1 changed files with 0 additions and 16 deletions
|
@ -1386,30 +1386,14 @@ 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(
|
||||||
|
|
Loading…
Add table
Reference in a new issue