diff options
-rw-r--r-- | src/client/documents/Documents.ts | 2 | ||||
-rw-r--r-- | src/client/views/InkingStroke.tsx | 2 | ||||
-rw-r--r-- | src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx | 8 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index 78a28ed62..2d2f5fe4a 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -1104,7 +1104,7 @@ export namespace Docs { I.color = color; I.fillColor = fillColor; I.stroke = new InkField(points); - I.stroke_xwidth = strokeWidth; + I.stroke_width = strokeWidth; I.stroke_bezier = stroke_bezier; I.stroke_startMarker = arrowStart; I.stroke_endMarker = arrowEnd; diff --git a/src/client/views/InkingStroke.tsx b/src/client/views/InkingStroke.tsx index 764062682..7e0b2ba92 100644 --- a/src/client/views/InkingStroke.tsx +++ b/src/client/views/InkingStroke.tsx @@ -334,7 +334,7 @@ export class InkingStroke extends ViewBoxBaseComponent<FieldViewProps>() impleme // const ptsXscale = (NumCast(radius) - NumCast(radius)) / (oldXrange.max - oldXrange.min || 1) || 1; // const ptsYscale = (NumCast(doc._height) - NumCast(doc.stroke_width)) / (oldYrange.max - oldYrange.min || 1) || 1; // const newPoints = func(this.DocumentView?.(), ink, ptsXscale, ptsYscale, NumCast(radius)); - const controlPointDistance = 0.552284749831 * radius; // tan(pi / 8) * radius + const controlPointDistance = 0.552284749831 * radius; // (4/3) * tan(pi / 8) * radius const points: { X: number; Y: number }[] = [ { X: inkCoords.X + radius, Y: inkCoords.Y }, // right point { X: inkCoords.X + radius, Y: inkCoords.Y - controlPointDistance }, // right's top ctrl point diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index a72b499b2..ef4ab55db 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -625,8 +625,8 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection setupMoveUpEvents(this, e, this.onEraserMove, this.onEraserUp, emptyFunction); break; case InkTool.RadiusEraser: - // this._batch = UndoManager.StartBatch('collectionErase'); - // setupMoveUpEvents(this, e, this.onEraserMove, this.onEraserUp, emptyFunction); + this._batch = UndoManager.StartBatch('collectionErase'); + setupMoveUpEvents(this, e, this.onEraserMove, this.onEraserUp, emptyFunction); break; case InkTool.None: if (!(this._props.layoutEngine?.() || StrCast(this.layoutDoc._layoutEngine))) { @@ -847,11 +847,11 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection const segments: Segment[] = []; var segment1: Segment = []; var segment2: Segment = []; - const eraseWidth = ActiveInkWidth(); + const eraseRadius = ActiveInkWidth() / 2; const inkStroke = ink?.ComponentView as InkingStroke; const { inkData } = (inkStroke).inkScaledData(); - const eraserInkData = inkStroke.splitByEraser(inkCoords, eraseWidth); + const eraserInkData = inkStroke.splitByEraser(inkCoords, eraseRadius); const tVals: number[] = []; // should be the tvals of the intersections |