diff options
author | yunahi <60233430+yunahi@users.noreply.github.com> | 2020-07-28 00:10:22 +0900 |
---|---|---|
committer | yunahi <60233430+yunahi@users.noreply.github.com> | 2020-07-28 00:10:22 +0900 |
commit | 65d3c9672fc3cf0dc981588f220dad269beb4aeb (patch) | |
tree | 5d170a07e763f12b306ecc11c25ae30fcdb9c8cd /src | |
parent | 258ad0d8628737e01613341437eb0421359ad168 (diff) |
fixed control points from moving
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/collections/collectionFreeForm/FormatShapePane.tsx | 8 |
1 files changed, 5 insertions, 3 deletions
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); } } } |