From d2c67049891493551e39f8c2423ee6e40109bb65 Mon Sep 17 00:00:00 2001 From: eleanor-park Date: Sun, 12 May 2024 01:00:42 -0400 Subject: trying out a circle around the cursor --- .../collectionFreeForm/CollectionFreeFormView.tsx | 35 ++++++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 2e174be30..ab47c105e 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -97,6 +97,8 @@ export class CollectionFreeFormView extends CollectionSubView { const currPoint = { X: e.clientX, Y: e.clientY }; @@ -775,6 +778,8 @@ export class CollectionFreeFormView extends CollectionSubView { + // this._eraserX = e.clientX; + // this._eraserY = e.clientY; const currPoint = { X: e.clientX, Y: e.clientY }; this._eraserPts.push([currPoint.X, currPoint.Y]); this._eraserPts = this._eraserPts.slice(Math.max(0, this._eraserPts.length - 5)); @@ -964,7 +969,6 @@ export class CollectionFreeFormView extends CollectionSubView= inkViewBounds.left && eraserMax.Y >= inkViewBounds.top ); - console.log("itersectnig strokes", intersectingStrokes); intersectingStrokes.forEach(({ inkStroke, inkView }) => { const { inkData } = inkStroke.inkScaledData(); const prevPointInkSpace = inkStroke.ptFromScreen(lastPoint); @@ -1007,7 +1011,6 @@ export class CollectionFreeFormView extends CollectionSubView 0) { - segments.push(currSegment); - return segments; - } + segments.push(currSegment); + return segments; } var continueErasing = false; var firstSegment: Segment = []; // early return if nothing to split on if (tVals.length === 0 || (tVals.length === 1 && tVals[0] === 0)) { + for (var i = 0; i < inkData.length - 3; i += 4) { + currSegment.push(InkField.Segment(inkData, i)); + } + segments.push(currSegment); return segments; } @@ -1082,6 +1087,9 @@ export class CollectionFreeFormView extends CollectionSubView { + this._eraserX = e.clientX; + this._eraserY = e.clientY; // super.setCursorPosition(this.getTransform().transformPoint(e.clientX, e.clientY)); }; @@ -2265,6 +2275,19 @@ export class CollectionFreeFormView extends CollectionSubView + {/*
*/} {this.paintFunc ? ( // need this so that any live dashfieldviews will update the underlying text that the code eval reads ) : this._lightboxDoc ? ( -- cgit v1.2.3-70-g09d2