diff options
| author | bobzel <zzzman@gmail.com> | 2022-08-23 15:05:10 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2022-08-23 15:05:10 -0400 |
| commit | 749fd6b1fff8ee8392de466ac2433f17ed093dec (patch) | |
| tree | 3d61bc3d13aa0369c705e739c183c97acf195acc /src/client/views/InkStrokeProperties.ts | |
| parent | 92cd2f5655c428252c8dc20df06bea024c43e2dc (diff) | |
| parent | 267bb35a555ac0f8b67041346213d9a06386785f (diff) | |
Merge branch 'master' into parker
Diffstat (limited to 'src/client/views/InkStrokeProperties.ts')
| -rw-r--r-- | src/client/views/InkStrokeProperties.ts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/client/views/InkStrokeProperties.ts b/src/client/views/InkStrokeProperties.ts index 821e2f739..1f5f16592 100644 --- a/src/client/views/InkStrokeProperties.ts +++ b/src/client/views/InkStrokeProperties.ts @@ -4,6 +4,7 @@ import { Doc, NumListCast, Opt } from '../../fields/Doc'; import { InkData, InkField, InkTool, PointData } from '../../fields/InkField'; import { List } from '../../fields/List'; import { listSpec } from '../../fields/Schema'; +import { ComputedField } from '../../fields/ScriptField'; import { Cast, NumCast } from '../../fields/Types'; import { Point } from '../../pen-gestures/ndollar'; import { DocumentType } from '../documents/DocumentTypes'; @@ -11,6 +12,7 @@ import { FitOneCurve } from '../util/bezierFit'; import { DocumentManager } from '../util/DocumentManager'; import { undoBatch } from '../util/UndoManager'; import { InkingStroke } from './InkingStroke'; +import { CollectionFreeFormDocumentView } from './nodes/CollectionFreeFormDocumentView'; import { DocumentView } from './nodes/DocumentView'; export class InkStrokeProperties { @@ -65,7 +67,13 @@ export class InkStrokeProperties { doc._height = (newYrange.max - newYrange.min) * ptsYscale + NumCast(doc.strokeWidth); doc.x = oldXrange.coord + (newXrange.min - oldXrange.min) * ptsXscale; doc.y = oldYrange.coord + (newYrange.min - oldYrange.min) * ptsYscale; - Doc.GetProto(doc).data = new InkField(newPoints); + if (doc.activeFrame !== undefined) { + const findexed = Cast(doc[`data-indexed`], listSpec(InkField), []).slice(); + findexed[NumCast(doc.activeFrame)] = new InkField(newPoints); + doc[`data-indexed`] = new List<InkField>(findexed); + } else { + Doc.GetProto(doc).data = new InkField(newPoints); + } appliedFunc = true; } } @@ -347,7 +355,6 @@ export class InkStrokeProperties { const deltaX = snapData.nearestPt.X - ink[controlIndex].X; const deltaY = snapData.nearestPt.Y - ink[controlIndex].Y; const res = this.moveControlPtHandle(inkView, deltaX, deltaY, controlIndex, ink.slice()); - console.log('X = ' + snapData.nearestPt.X + ' ' + snapData.nearestPt.Y); return res; } } |
