From 8f70b15a7050ea505544e83ff7380a743b8e319e Mon Sep 17 00:00:00 2001 From: bob Date: Wed, 20 Feb 2019 17:54:12 -0500 Subject: more fixes for selection. --- src/client/views/collections/CollectionDockingView.tsx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx index fc5b8dacd..5e30c0390 100644 --- a/src/client/views/collections/CollectionDockingView.tsx +++ b/src/client/views/collections/CollectionDockingView.tsx @@ -242,6 +242,20 @@ export class DockedFrameRenderer extends React.Component { @observable private Document: Opt; + @action + setScaling = (r: any) => { + let nativeWidth = this.Document!.GetNumber(KeyStore.NativeWidth, 0); + let nativeHeight = this.Document!.GetNumber(KeyStore.NativeWidth, 0); + this._parentScaling = nativeWidth > 0 ? r.entry.width / nativeWidth : 1; + this._nativeWidth = r.entry.width ? r.entry.width : nativeWidth; + this._nativeHeight = nativeWidth ? r.entry.width / nativeWidth * nativeHeight : nativeHeight; + } + + @observable + private _nativeWidth = 0; + @observable + private _nativeHeight = 0; + render() { if (!this.Document) return
@@ -253,7 +267,7 @@ export class DockedFrameRenderer extends React.Component { AddDocument={undefined} RemoveDocument={undefined} Scaling={this._parentScaling} - PanelSize={[0, 0]} + PanelSize={[this._nativeWidth, this._nativeHeight]} ScreenToLocalTransform={() => { let { scale, translateX, translateY } = Utils.GetScreenTransform(this._mainCont); var props = CollectionDockingView.Instance.props; @@ -265,7 +279,7 @@ export class DockedFrameRenderer extends React.Component { if (nativeWidth > 0 && (layout.indexOf("CollectionFreeForm") == -1 || layout.indexOf("AnnotationsKey") != -1)) { // contents of documents should be scaled if document is not a freeform view, or if the freeformview is an annotation layer (presumably on a document that is not a freeformview) - return this._parentScaling = nativeWidth > 0 ? r.entry.width / nativeWidth : 1)}> + return {({ measureRef }) =>
{content}
}
} -- cgit v1.2.3-70-g09d2