From 122076af3edfd432e6abe3b2571f21034d5c16e5 Mon Sep 17 00:00:00 2001 From: Tyler Schicke Date: Wed, 23 Jan 2019 01:21:15 -0500 Subject: Small changes and more work on drag drop stuff --- src/stores/NodeCollectionStore.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/stores') 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 -- cgit v1.2.3-70-g09d2