From af42b410a1575527094e2ec96e7df72f224ef45d Mon Sep 17 00:00:00 2001 From: bob Date: Tue, 19 Feb 2019 17:15:59 -0500 Subject: clean up and aspect resizing w/ doc dec. --- src/client/views/collections/CollectionDockingView.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/client/views/collections/CollectionDockingView.tsx') diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx index 9c396e412..842312faa 100644 --- a/src/client/views/collections/CollectionDockingView.tsx +++ b/src/client/views/collections/CollectionDockingView.tsx @@ -98,7 +98,6 @@ export class CollectionDockingView extends CollectionViewBase { if (this._goldenLayout.root.contentItems[0].isRow) { this._goldenLayout.root.contentItems[0].addChild(newContentItem); - collayout.callDownwards('setSize'); } else { var collayout = this._goldenLayout.root.contentItems[0]; @@ -110,7 +109,6 @@ export class CollectionDockingView extends CollectionViewBase { collayout.config["width"] = 50; newContentItem.config["width"] = 50; - collayout.parent.callDownwards('setSize'); } this._forceRecreate = true; } @@ -227,12 +225,16 @@ interface DockedFrameProps { @observer export class DockedFrameRenderer extends React.Component { - private _mainCont = React.createRef(); + _mainCont: any = null; constructor(props: any) { super(props); Server.GetField(this.props.documentId, (f) => { this.Document = f as Document; }) } + setMainCont: any = (element: any) => { + this._mainCont = element; + } + @observable private _parentScaling = 1; // used to transfer the dimensions of the content pane in the DOM to the ParentScaling prop of the DocumentView @@ -245,13 +247,13 @@ export class DockedFrameRenderer extends React.Component { let nativeWidth = this.Document.GetNumber(KeyStore.NativeWidth, 0); var layout = this.Document.GetText(KeyStore.Layout, ""); var content = -
+
{ - let { scale, translateX, translateY } = Utils.GetScreenTransform(this._mainCont.current!); + let { scale, translateX, translateY } = Utils.GetScreenTransform(this._mainCont); var props = CollectionDockingView.Instance.props; return props.ScreenToLocalTransform().translate(-translateX, -translateY).scale(scale / this._parentScaling) }} -- cgit v1.2.3-70-g09d2