diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-02-20 19:42:24 -0500 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-02-20 19:42:24 -0500 |
commit | d500c57290bff9d82d542b5756601b466a46c8c7 (patch) | |
tree | 71bea70faf541a7e48ec5f4ab1ccd3d706748b39 /src/client/views/nodes/DocumentView.tsx | |
parent | 778abc78c6f423ec9247a9f9b1fe6a60ea07531c (diff) |
cleaned up screen transforms at last.
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 4eb49f18f..20875586d 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -246,20 +246,6 @@ export class DocumentView extends React.Component<DocumentViewProps> { SelectionManager.SelectDoc(this, ctrlPressed) } - ScreenToLocalTransform = () => { - return this.props.PanelSize[0] ? this.backgroundScreenToLocalTransform() : this.props.ScreenToLocalTransform(); - } - - backgroundScreenToLocalTransform = () => { - if (this.props.PanelSize[0]) - return this.props.ScreenToLocalTransform().scale(this.props.Scaling); - else return this.props.ScreenToLocalTransform().scale(1 / this.props.Scaling); - } - documentScreenToLocalTransform = () => { - if (this.props.PanelSize[0]) - return this.props.ScreenToLocalTransform(); - else return this.backgroundScreenToLocalTransform(); - } render() { if (!this.props.Document) return <div></div> @@ -269,7 +255,6 @@ export class DocumentView extends React.Component<DocumentViewProps> { } let documentBindings = { ...this.props, - ScreenToLocalTransform: this.documentScreenToLocalTransform, // adds 'Scaling' to the screen to local Xf isSelected: this.isSelected, select: this.select } as any; @@ -289,13 +274,9 @@ export class DocumentView extends React.Component<DocumentViewProps> { */ let backgroundLayout = this.backgroundLayout; if (backgroundLayout) { - let backgroundBindings = { - ...documentBindings, - ScreenToLocalTransform: this.backgroundScreenToLocalTransform, // adds 'Scaling' to the screen to local Xf - } let backgroundView = () => (<JsxParser components={{ FormattedTextBox, ImageBox, CollectionFreeFormView, CollectionDockingView, CollectionSchemaView }} - bindings={backgroundBindings} + bindings={documentBindings} jsx={this.backgroundLayout} showWarnings={true} onError={(test: any) => { console.log(test) }} |