diff options
| author | Lauren <victor_kalev@brown.edu> | 2021-10-28 16:07:11 -0400 |
|---|---|---|
| committer | Lauren <victor_kalev@brown.edu> | 2021-10-28 16:07:11 -0400 |
| commit | 4bbfe0fad535033309e352311fae64520b9068a6 (patch) | |
| tree | 5c6bf40d7c93eccace91da26404bfc945e274ae6 /src/client/views/GestureOverlay.tsx | |
| parent | 4aeddc57b8d6654074adaf4cdbf542f1564a9dcc (diff) | |
adding eraser tool to menu
Diffstat (limited to 'src/client/views/GestureOverlay.tsx')
| -rw-r--r-- | src/client/views/GestureOverlay.tsx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/client/views/GestureOverlay.tsx b/src/client/views/GestureOverlay.tsx index f28485e43..99829139f 100644 --- a/src/client/views/GestureOverlay.tsx +++ b/src/client/views/GestureOverlay.tsx @@ -3,7 +3,7 @@ import * as fitCurve from 'fit-curve'; import { action, computed, observable, runInAction } from "mobx"; import { observer } from "mobx-react"; import { Doc } from "../../fields/Doc"; -import { InkData, InkTool } from "../../fields/InkField"; +import { InkData, InkTool, PointData } from "../../fields/InkField"; import { Cast, FieldValue, NumCast } from "../../fields/Types"; import MobileInkOverlay from "../../mobile/MobileInkOverlay"; import { GestureUtils } from "../../pen-gestures/GestureUtils"; @@ -490,11 +490,18 @@ export class GestureOverlay extends Touchable { } @action + checkInkIntersection = (point: PointData) => { + + } + + @action onPointerDown = (e: React.PointerEvent) => { if (InteractionUtils.IsType(e, InteractionUtils.PENTYPE) || [InkTool.Highlighter, InkTool.Pen].includes(CurrentUserUtils.SelectedTool)) { this._points.push({ X: e.clientX, Y: e.clientY }); setupMoveUpEvents(this, e, this.onPointerMove, this.onPointerUp, emptyFunction); // if (CurrentUserUtils.SelectedTool === InkTool.Highlighter) SetActiveInkColor("rgba(245, 230, 95, 0.75)"); + } else if (InteractionUtils.IsType(e, InteractionUtils.ERASERTYPE)) { + this.checkInkIntersection({ X: e.clientX, Y: e.clientY }); } } |
