diff options
author | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-04-14 17:41:51 -0500 |
---|---|---|
committer | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-04-14 17:41:51 -0500 |
commit | e7469b5454acd59238dfeb5a7e023a591a23d852 (patch) | |
tree | fa30ffeaf57ee884445e5464ffd49fe03503d4c6 /src/client/views/nodes/CollectionFreeFormDocumentView.tsx | |
parent | c17e8ebf0454ad2067ab6556355c5bb69b7cf41e (diff) | |
parent | ad863eaee3af92c3bfec6dc72bc5d9ee5eec31d4 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into script_documents
Diffstat (limited to 'src/client/views/nodes/CollectionFreeFormDocumentView.tsx')
-rw-r--r-- | src/client/views/nodes/CollectionFreeFormDocumentView.tsx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx index f9f5f449c..e7cb2c015 100644 --- a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx +++ b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx @@ -59,6 +59,10 @@ export class CollectionFreeFormDocumentView extends DocComponent<CollectionFreeF } return undefined; } + nudge = (x: number, y: number) => { + this.props.Document.x = NumCast(this.props.Document.x) + x; + this.props.Document.y = NumCast(this.props.Document.y) + y; + } contentScaling = () => this.nativeWidth > 0 && !this.props.fitToBox && !this.freezeDimensions ? this.width / this.nativeWidth : 1; panelWidth = () => (this.dataProvider?.width || this.props.PanelWidth?.()); @@ -93,6 +97,7 @@ export class CollectionFreeFormDocumentView extends DocComponent<CollectionFreeF {!this.props.fitToBox ? <DocumentView {...this.props} + nudge={this.nudge} dragDivName={"collectionFreeFormDocumentView-container"} ContentScaling={this.contentScaling} ScreenToLocalTransform={this.getTransform} |