aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanley Yip <stanley_yip@brown.edu>2019-12-08 15:07:52 -0500
committerStanley Yip <stanley_yip@brown.edu>2019-12-08 15:07:52 -0500
commit4ead7eccb8ed9dd5708384315f8c5454b9725106 (patch)
tree9c90346c1f18d7be2f5eca2252d43a5cc4b74d47
parent3a2aaf5ffec2a568bb749c6ac0df8367a150af39 (diff)
smal fix
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx9
1 files changed, 6 insertions, 3 deletions
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));