aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentManager.tsx
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-03-01 22:17:50 -0500
committerTyler Schicke <tyler_schicke@brown.edu>2019-03-01 22:17:50 -0500
commit13a5b32b04e65c154aeb12190e761d8174b858e9 (patch)
tree8727edb1291c7c7be4d2eed9c07fd936dcd2db85 /src/client/views/DocumentManager.tsx
parent98ade639c6ffa6cc704cc310af506973d83e494b (diff)
some fixes
Diffstat (limited to 'src/client/views/DocumentManager.tsx')
-rw-r--r--src/client/views/DocumentManager.tsx18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/client/views/DocumentManager.tsx b/src/client/views/DocumentManager.tsx
index 750b7aecf..a53ed4a91 100644
--- a/src/client/views/DocumentManager.tsx
+++ b/src/client/views/DocumentManager.tsx
@@ -198,7 +198,7 @@ export class DocumentManager {
// }
@action
- public centerNode(doc: Document | DocumentView, x: number, y: number): any {
+ public centerNode(doc: Document | DocumentView, collection: Document): void {
//console.log(doc.Title)
//gets document view that is in freeform collection
let docView: DocumentView | null;
@@ -218,13 +218,15 @@ export class DocumentManager {
if (docView) {
let { width, height } = docView.size();
- let scale = docView.props.Document.GetNumber(KeyStore.Scale, 1)
- let doc = docView.props.Document
+ let scale = docView.props.Document.GetNumber(KeyStore.Scale, 1);
+ let doc = docView.props.Document;
+ let x = doc.GetNumber(KeyStore.X, 0);
+ let y = doc.GetNumber(KeyStore.X, 0);
if (x && y) {
XView = (-x * scale) - (width * scale / 2);
YView = (-y * scale) - (height * scale / 2);
- DocumentManager.Instance.setViewportXY(docView, XView, YView)
+ DocumentManager.Instance.setViewportXY(collection, XView, YView)
}
}
@@ -274,10 +276,8 @@ export class DocumentManager {
@action
- private setViewportXY(collection: DocumentView, x: number, y: number) {
- console.log("setting")
- let doc = collection.props.Document;
- doc.SetNumber(KeyStore.PanX, x);
- doc.SetNumber(KeyStore.PanY, y);
+ private setViewportXY(collection: Document, x: number, y: number) {
+ collection.SetNumber(KeyStore.PanX, x);
+ collection.SetNumber(KeyStore.PanY, y);
}
} \ No newline at end of file