aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/InkStrokeProperties.ts8
-rw-r--r--src/client/views/nodes/PresBox.tsx19
2 files changed, 4 insertions, 23 deletions
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,7 +191,6 @@ export class InkStrokeProperties {
doc._height = (bottom - top);
doc._width = (right - left);
-
}
index++;
}
@@ -200,13 +199,6 @@ export class InkStrokeProperties {
@undoBatch
@action
- resetPoints = () => {
-
- }
-
-
- @undoBatch
- @action
control = (xDiff: number, yDiff: number, controlNum: number) => {
this.selectedInk?.forEach(action(inkView => {
if (this.selectedInk?.length === 1) {
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<FieldViewProps, PresBoxSchema>
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);
}
-
}
-
}
}