From 03e1904739a874afb628cc5240b2a28a9a76d529 Mon Sep 17 00:00:00 2001 From: Steve Ruiz Date: Sat, 12 Jun 2021 17:46:36 +0100 Subject: [PATCH] Skip projected points on mobile --- state/sessions/draw-session.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/state/sessions/draw-session.ts b/state/sessions/draw-session.ts index fbd7816f6..9a6c67a45 100644 --- a/state/sessions/draw-session.ts +++ b/state/sessions/draw-session.ts @@ -2,7 +2,7 @@ import { current } from 'immer' import { Data, DrawShape } from 'types' import BaseSession from './base-session' import { getShapeUtils } from 'lib/shape-utils' -import { getPage, getShape, updateParents } from 'utils/utils' +import { getPage, getShape, isMobile, updateParents } from 'utils/utils' import * as vec from 'utils/vec' import commands from 'state/commands' @@ -119,7 +119,8 @@ export default class BrushSession extends BaseSession { // If the delta between the averaged point and the real point is // too great, skip the temporary points. This avoids "sawblading". - const tooFarForTemporaryPoints = vec.dist(newPoint, temporaryPoints[3]) > 32 + const tooFarForTemporaryPoints = + !isMobile() && vec.dist(newPoint, temporaryPoints[3]) > 32 // Update the points and update the shape's parents. const shape = getShape(data, snapshot.id) as DrawShape