diff options
author | Tyler Schicke <tyler_schicke@brown.edu> | 2019-01-23 01:21:15 -0500 |
---|---|---|
committer | Tyler Schicke <tyler_schicke@brown.edu> | 2019-01-23 01:21:15 -0500 |
commit | 122076af3edfd432e6abe3b2571f21034d5c16e5 (patch) | |
tree | ac95a480f110e1b9ce4c71b057fa6d403038f8e7 /src/stores/NodeCollectionStore.ts | |
parent | 8a1915a73d1d1173059a212db3b79f8efcdd9e9e (diff) |
Small changes and more work on drag drop stuff
Diffstat (limited to 'src/stores/NodeCollectionStore.ts')
-rw-r--r-- | src/stores/NodeCollectionStore.ts | 3 |
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 |