aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-04-12 19:23:21 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-04-12 19:23:21 -0400
commit22d1499703ddb20d0f937364085e46fefcc663da (patch)
tree61722cec308662e6fc88a4f03114039df1a23486 /src/client/views/nodes/CollectionFreeFormDocumentView.tsx
parent23d6d5eaa71a83691e0c711bce9e84d2967d2f4c (diff)
added nudging of documents
Diffstat (limited to 'src/client/views/nodes/CollectionFreeFormDocumentView.tsx')
-rw-r--r--src/client/views/nodes/CollectionFreeFormDocumentView.tsx5
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..3503af442 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.layoutDoc.x = NumCast(this.layoutDoc.x) + x;
+ this.layoutDoc.y = NumCast(this.layoutDoc.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}