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/CollectionFreeFormDocumentView.tsx | |
parent | 778abc78c6f423ec9247a9f9b1fe6a60ea07531c (diff) |
cleaned up screen transforms at last.
Diffstat (limited to 'src/client/views/nodes/CollectionFreeFormDocumentView.tsx')
-rw-r--r-- | src/client/views/nodes/CollectionFreeFormDocumentView.tsx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx index bb85f85a3..7cad6ffc1 100644 --- a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx +++ b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx @@ -77,7 +77,9 @@ export class CollectionFreeFormDocumentView extends React.Component<DocumentView getTransform = (): Transform => { - return this.props.ScreenToLocalTransform().translate(-this.props.Document.GetNumber(KeyStore.X, 0), -this.props.Document.GetNumber(KeyStore.Y, 0)); + var parentScaling = this.nativeWidth > 0 ? this.width / this.nativeWidth : 1; + return this.props.ScreenToLocalTransform(). + translate(-this.props.Document.GetNumber(KeyStore.X, 0), -this.props.Document.GetNumber(KeyStore.Y, 0)).scale(1 / parentScaling); } render() { @@ -93,7 +95,10 @@ export class CollectionFreeFormDocumentView extends React.Component<DocumentView backgroundColor: "transparent" }} > - <DocumentView {...this.props} Scaling={parentScaling} ScreenToLocalTransform={this.getTransform} /> + <DocumentView {...this.props} + Scaling={parentScaling} + ScreenToLocalTransform={this.getTransform} + /> </div> ); } |