diff options
author | Philipp Eichmann <philipp.eichmann@gmail.com> | 2018-12-21 18:45:24 -0500 |
---|---|---|
committer | Philipp Eichmann <philipp.eichmann@gmail.com> | 2018-12-21 18:45:24 -0500 |
commit | 06098b7bdd6a83f6b9cc07d2377f2a19cc0ecaa6 (patch) | |
tree | d665964243f9949424555175711e27166e96f70e /src/stores/NodeCollectionStore.ts | |
parent | 9caa9ca4a0b413e2da03eff4856cb324939d77d4 (diff) |
added code
Diffstat (limited to 'src/stores/NodeCollectionStore.ts')
-rw-r--r-- | src/stores/NodeCollectionStore.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/stores/NodeCollectionStore.ts b/src/stores/NodeCollectionStore.ts new file mode 100644 index 000000000..8c7f7623b --- /dev/null +++ b/src/stores/NodeCollectionStore.ts @@ -0,0 +1,21 @@ +import { computed, observable, action } from "mobx"; +import { NodeStore } from "./NodeStore"; + +export class NodeCollectionStore extends NodeStore { + + @observable + public Scale: number = 1; + + @observable + public Nodes: NodeStore[] = new Array<NodeStore>(); + + @computed + public get Transform(): string { + return "translate(" + this.X + "px," + this.Y + "px) scale(" + this.Scale + "," + this.Scale + ")"; + } + + @action + public AddNodes(stores: NodeStore[]): void { + stores.forEach(store => this.Nodes.push(store)); + } +}
\ No newline at end of file |