From a8545c5f31200d2d58696223c5050cbf9cf553ae Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 11 Jan 2021 13:35:56 -0500 Subject: from last --- src/client/views/InkStrokeProperties.ts | 8 -------- src/client/views/nodes/PresBox.tsx | 19 ++++--------------- 2 files changed, 4 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/client/views/InkStrokeProperties.ts b/src/client/views/InkStrokeProperties.ts index 73591c6a6..fcc6b9da0 100644 --- a/src/client/views/InkStrokeProperties.ts +++ b/src/client/views/InkStrokeProperties.ts @@ -191,20 +191,12 @@ export class InkStrokeProperties { doc._height = (bottom - top); doc._width = (right - left); - } index++; } })); } - @undoBatch - @action - resetPoints = () => { - - } - - @undoBatch @action control = (xDiff: number, yDiff: number, controlNum: number) => { diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx index fb3598a04..271a7274f 100644 --- a/src/client/views/nodes/PresBox.tsx +++ b/src/client/views/nodes/PresBox.tsx @@ -774,33 +774,22 @@ export class PresBox extends ViewBoxBaseComponent if (doc.presPinView || doc.presentationTargetDoc === this.layoutDoc.presCollection) setTimeout(() => this.updateCurrentPresentation(context), 0); else this.updateCurrentPresentation(context); - - if (this.targetDoc.isInkMask) { if (this.activeItem.y !== undefined && this.activeItem.x !== undefined && this.targetDoc.y !== undefined && this.targetDoc.y !== undefined) { const timer = (ms: number) => new Promise(res => this._presTimer = setTimeout(res, ms)); - - const ydiff = this.activeItem.y - this.targetDoc.y; - const xdiff = this.activeItem.x - this.targetDoc.x; - const time = 10; - - const yOffset = ydiff / time; - const xOffset = xdiff / time; + const ydiff = NumCast(this.activeItem.y) - NumCast(this.targetDoc.y); + const xdiff = NumCast(this.activeItem.x) - NumCast(this.targetDoc.x); for (let i = 0; i < time; i++) { - const newy = Number(this.targetDoc.y) + yOffset; - const newx = Number(this.targetDoc.x) + xOffset; - this.targetDoc.y = newy; - this.targetDoc.x = newx; + this.targetDoc.x = NumCast(this.targetDoc.x) + xdiff / time; + this.targetDoc.y = NumCast(this.targetDoc.y) + ydiff / time; await timer(0.1); } - } - } } -- cgit v1.2.3-70-g09d2