From 65d3c9672fc3cf0dc981588f220dad269beb4aeb Mon Sep 17 00:00:00 2001 From: yunahi <60233430+yunahi@users.noreply.github.com> Date: Tue, 28 Jul 2020 00:10:22 +0900 Subject: fixed control points from moving --- .../views/collections/collectionFreeForm/FormatShapePane.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/collectionFreeForm/FormatShapePane.tsx b/src/client/views/collections/collectionFreeForm/FormatShapePane.tsx index a47430453..adb71c6aa 100644 --- a/src/client/views/collections/collectionFreeForm/FormatShapePane.tsx +++ b/src/client/views/collections/collectionFreeForm/FormatShapePane.tsx @@ -242,8 +242,8 @@ export default class FormatShapePane extends AntimodeMenu { } const oldx = doc.x; const oldy = doc.y; - const xs = newPoints.map(p => p.X); - const ys = newPoints.map(p => p.Y); + const xs = ink.map(p => p.X); + const ys = ink.map(p => p.Y); const left = Math.min(...xs); const top = Math.min(...ys); doc.data = new InkField(newPoints); @@ -255,9 +255,11 @@ export default class FormatShapePane extends AntimodeMenu { const bottom2 = Math.max(...ys2); doc._height = (bottom2 - top2); doc._width = (right2 - left2); - + //if points move out of bounds + console.log(doc.x); doc.x = oldx - (left - left2); doc.y = oldy - (top - top2); + console.log(doc.x); } } } -- cgit v1.2.3-70-g09d2