From 4ead7eccb8ed9dd5708384315f8c5454b9725106 Mon Sep 17 00:00:00 2001 From: Stanley Yip Date: Sun, 8 Dec 2019 15:07:52 -0500 Subject: smal fix --- .../collections/collectionFreeForm/CollectionFreeFormView.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 5a7644d05..7b507f739 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -351,9 +351,12 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) { let r = l + doc[WidthSym](); let t = NumCast(doc.y); let b = t + doc[HeightSym](); - doc.x = l - B.left - B.width / 2; - doc.y = t - B.top - B.height / 2; - return !(bounds.x > r || bounds.r < l || bounds.y > b || bounds.b < t); + let pass = !(bounds.x > r || bounds.r < l || bounds.y > b || bounds.b < t); + if (pass) { + doc.x = l - B.left - B.width / 2; + doc.y = t - B.top - B.height / 2; + } + return pass; }); this.addDocument(Docs.Create.FreeformDocument(sel, { x: B.left, y: B.top, width: B.width, height: B.height, panX: 0, panY: 0 })); sel.forEach(d => this.props.removeDocument(d)); -- cgit v1.2.3-70-g09d2