aboutsummaryrefslogtreecommitdiff
path: root/src/stores/NodeCollectionStore.ts
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-01-26 17:23:25 -0500
committerTyler Schicke <tyler_schicke@brown.edu>2019-01-26 17:23:25 -0500
commitba3c6773a04ea83facab1f67db0025d6185c2c65 (patch)
treebe39c0c927ae4649c8505ef33c7f1c8272974ca2 /src/stores/NodeCollectionStore.ts
parentf98e634ae7070cd841bc523514d147195308696c (diff)
parent122076af3edfd432e6abe3b2571f21034d5c16e5 (diff)
Merge branch 'master' into move_doc_get_out_the_way
Diffstat (limited to 'src/stores/NodeCollectionStore.ts')
-rw-r--r--src/stores/NodeCollectionStore.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/stores/NodeCollectionStore.ts b/src/stores/NodeCollectionStore.ts
index ac4f515f1..7fac83d51 100644
--- a/src/stores/NodeCollectionStore.ts
+++ b/src/stores/NodeCollectionStore.ts
@@ -15,7 +15,8 @@ export class NodeCollectionStore extends NodeStore {
@computed
public get Transform(): string {
- return "translate(" + this.X + "px," + this.Y + "px) scale(" + this.Scale + "," + this.Scale + ")";
+ const halfWidth = window.innerWidth / 2, halfHeight = window.innerHeight / 2;
+ return `translate(${this.X + halfWidth}px, ${this.Y + halfHeight}px) scale(${this.Scale}) translate(${-halfWidth}px, ${-halfHeight}px)`;
}
@action