fix
This commit is contained in:
parent
dbf4a86134
commit
c0c66ad36e
1 changed files with 2 additions and 2 deletions
|
|
@ -60,7 +60,7 @@ func (g *Graph) ExtractAsNestedGraph(obj *Object) *Graph {
|
|||
func pluckObjAndEdges(g *Graph, obj *Object) (descendantsObjects []*Object, edges []*Edge) {
|
||||
for i := 0; i < len(g.Edges); i++ {
|
||||
edge := g.Edges[i]
|
||||
if edge.Src.IsDescendantOf(obj) || edge.Dst.IsDescendantOf(obj) {
|
||||
if edge.Src.IsDescendantOf(obj) && edge.Dst.IsDescendantOf(obj) {
|
||||
edges = append(edges, edge)
|
||||
g.Edges = append(g.Edges[:i], g.Edges[i+1:]...)
|
||||
i--
|
||||
|
|
@ -70,7 +70,7 @@ func pluckObjAndEdges(g *Graph, obj *Object) (descendantsObjects []*Object, edge
|
|||
for i := 0; i < len(g.Objects); i++ {
|
||||
temp := g.Objects[i]
|
||||
if temp.IsDescendantOf(obj) {
|
||||
descendantsObjects = append(descendantsObjects, obj)
|
||||
descendantsObjects = append(descendantsObjects, temp)
|
||||
g.Objects = append(g.Objects[:i], g.Objects[i+1:]...)
|
||||
i--
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue