diff options
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> ); } |