fix: incorrectly erasing on mobile (#4899)
* fix: incorrectly erasing on mobile * reintroduce fix for erasing on single-point click * fix snaps
This commit is contained in:
parent
7daf1a7944
commit
b682d88167
@ -2984,7 +2984,21 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
this.lastPointerUp = event;
|
this.lastPointerUp = event;
|
||||||
const isTouchScreen = ["pen", "touch"].includes(event.pointerType);
|
const isTouchScreen = ["pen", "touch"].includes(event.pointerType);
|
||||||
|
|
||||||
if (isTouchScreen || isEraserActive(this.state)) {
|
if (isTouchScreen) {
|
||||||
|
const scenePointer = viewportCoordsToSceneCoords(
|
||||||
|
{ clientX: event.clientX, clientY: event.clientY },
|
||||||
|
this.state,
|
||||||
|
);
|
||||||
|
const hitElement = this.getElementAtPosition(
|
||||||
|
scenePointer.x,
|
||||||
|
scenePointer.y,
|
||||||
|
);
|
||||||
|
this.hitLinkElement = this.getElementLinkAtPosition(
|
||||||
|
scenePointer,
|
||||||
|
hitElement,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (isEraserActive(this.state)) {
|
||||||
const scenePointer = viewportCoordsToSceneCoords(
|
const scenePointer = viewportCoordsToSceneCoords(
|
||||||
{ clientX: event.clientX, clientY: event.clientY },
|
{ clientX: event.clientX, clientY: event.clientY },
|
||||||
this.state,
|
this.state,
|
||||||
|
@ -16860,7 +16860,7 @@ Object {
|
|||||||
|
|
||||||
exports[`regression tests two-finger scroll works: [end of test] number of elements 1`] = `0`;
|
exports[`regression tests two-finger scroll works: [end of test] number of elements 1`] = `0`;
|
||||||
|
|
||||||
exports[`regression tests two-finger scroll works: [end of test] number of renders 1`] = `16`;
|
exports[`regression tests two-finger scroll works: [end of test] number of renders 1`] = `12`;
|
||||||
|
|
||||||
exports[`regression tests undo/redo drawing an element: [end of test] appState 1`] = `
|
exports[`regression tests undo/redo drawing an element: [end of test] appState 1`] = `
|
||||||
Object {
|
Object {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user