From 778abc78c6f423ec9247a9f9b1fe6a60ea07531c Mon Sep 17 00:00:00 2001 From: bob Date: Wed, 20 Feb 2019 18:02:36 -0500 Subject: piddling. --- src/client/views/nodes/DocumentView.tsx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index fa39ad09a..4eb49f18f 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -267,24 +267,20 @@ export class DocumentView extends React.Component { if (!lkeys || lkeys === "") { return

Error loading layout keys

; } - let backgroundBindings = { + let documentBindings = { ...this.props, - ScreenToLocalTransform: this.backgroundScreenToLocalTransform, // adds 'Scaling' to the screen to local Xf + ScreenToLocalTransform: this.documentScreenToLocalTransform, // adds 'Scaling' to the screen to local Xf isSelected: this.isSelected, select: this.select } as any; for (const key of this.layoutKeys) { - backgroundBindings[key.Name + "Key"] = key; // this maps string values of the form Key to an actual key Kestore.keyname e.g, "DataKey" => KeyStore.Data + documentBindings[key.Name + "Key"] = key; // this maps string values of the form Key to an actual key Kestore.keyname e.g, "DataKey" => KeyStore.Data } for (const key of this.layoutFields) { let field = this.props.Document.Get(key); - backgroundBindings[key.Name] = field && field != FieldWaiting ? field.GetValue() : field; + documentBindings[key.Name] = field && field != FieldWaiting ? field.GetValue() : field; } - let documentBindings = { - ...backgroundBindings, - ScreenToLocalTransform: this.documentScreenToLocalTransform, // adds 'Scaling' to the screen to local Xf - } /* tfs: Should this be moved to CollectionFreeformView or another component that renders @@ -293,6 +289,10 @@ export class DocumentView extends React.Component { */ let backgroundLayout = this.backgroundLayout; if (backgroundLayout) { + let backgroundBindings = { + ...documentBindings, + ScreenToLocalTransform: this.backgroundScreenToLocalTransform, // adds 'Scaling' to the screen to local Xf + } let backgroundView = () => ( { documentBindings.BackgroundView = backgroundView; } - var width = this.props.Document.GetNumber(KeyStore.NativeWidth, 0); - var strwidth = width > 0 ? width.toString() + "px" : "100%"; - var height = this.props.Document.GetNumber(KeyStore.NativeHeight, 0); - var strheight = height > 0 ? height.toString() + "px" : "100%"; + var nativeWidth = this.props.Document.GetNumber(KeyStore.NativeWidth, 0); + var nativeHeight = this.props.Document.GetNumber(KeyStore.NativeHeight, 0); + var nodeWidth = nativeWidth > 0 ? nativeWidth.toString() + "px" : "100%"; + var nodeHeight = nativeHeight > 0 ? nativeHeight.toString() + "px" : "100%"; var scaling = this.props.Scaling; return ( -