Fix overlapping groups
This commit is contained in:
@@ -4,6 +4,10 @@ class LayoutGroup {
|
||||
this.nodesByPos_ = nodesByPos;
|
||||
this.nodes = new Set(nodes);
|
||||
this.tension = 0;
|
||||
|
||||
for (let node of nodes) {
|
||||
node.groups.push(this);
|
||||
}
|
||||
}
|
||||
|
||||
setTension() {
|
||||
@@ -68,6 +72,12 @@ class LayoutGroup {
|
||||
return [min, max];
|
||||
}
|
||||
|
||||
isContained(pos) {
|
||||
let [min, max] = this.getMinMax();
|
||||
return (pos[0] >= min[0] && pos[0] <= max[0] &&
|
||||
pos[1] >= min[1] && pos[1] <= max[1]);
|
||||
}
|
||||
|
||||
getStep() {
|
||||
if (!this.graphGroup_) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user