aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-10-17 19:47:01 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-10-17 19:47:01 -0400
commit929584999080616adb350df638b640f770c6f44a (patch)
tree7734175d7a9ad4e91114a022f52cc26004d612fd /src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
parent1566b94d5ee5da0004540e1b2e5234ae922dcc51 (diff)
fixed some display issues with templates and linking
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 2b0ef8ada..5dccb5bf0 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -408,8 +408,9 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) {
this.props.Document.scrollY = NumCast(doc.y) - offset;
}
} else {
- const newPanX = NumCast(doc.x) + NumCast(doc.width) / 2;
- const newPanY = NumCast(doc.y) + NumCast(doc.height) / 2;
+ let layoutdoc = doc.layout instanceof Doc ? doc.layout : doc;
+ const newPanX = NumCast(layoutdoc.x) + NumCast(layoutdoc.width) / 2;
+ const newPanY = NumCast(layoutdoc.y) + NumCast(layoutdoc.height) / 2;
const newState = HistoryUtil.getState();
newState.initializers![this.Document[Id]] = { panX: newPanX, panY: newPanY };
HistoryUtil.pushState(newState);
@@ -420,7 +421,7 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) {
this.Document.panTransformType = "Ease";
Doc.BrushDoc(this.props.Document);
this.props.focus(this.props.Document);
- willZoom && this.setScaleToZoom(doc, scale);
+ willZoom && this.setScaleToZoom(layoutdoc, scale);
afterFocus && setTimeout(() => {
if (afterFocus && afterFocus()) {