Create StringMap

This commit is contained in:
Ian Gulliver
2019-07-05 16:18:22 +00:00
parent 396436aa01
commit 29babaf1e0
4 changed files with 36 additions and 18 deletions

View File

@@ -4,7 +4,7 @@ class LayoutNode {
this.nodesByPos_ = nodesByPos;
this.pos = pos;
this.nodesByPos_.set(this.pos.toString(), this);
this.nodesByPos_.set(this.pos, this);
}
resolveAffinity(nodesByGraphNode) {
@@ -45,13 +45,13 @@ class LayoutNode {
offsetCollides(offset) {
let newPos = this.offsetToPos(offset);
return this.nodesByPos_.get(newPos.toString());
return this.nodesByPos_.get(newPos);
}
moveTo(pos) {
this.nodesByPos_.delete(this.pos.toString());
this.nodesByPos_.delete(this.pos);
this.pos = pos;
this.nodesByPos_.set(this.pos.toString(), this);
this.nodesByPos_.set(this.pos, this);
}
moveBy(offset) {