edge case of edges on grid container
This commit is contained in:
parent
10775c2f32
commit
46bd6aeee5
3 changed files with 11 additions and 5 deletions
|
|
@ -2476,15 +2476,17 @@ d2/testdata/d2compiler/TestCompile/grid_gap_negative.d2:3:16: vertical-gap must
|
||||||
name: "grid_edge",
|
name: "grid_edge",
|
||||||
text: `hey: {
|
text: `hey: {
|
||||||
grid-rows: 1
|
grid-rows: 1
|
||||||
a -> b
|
a -> b: ok
|
||||||
}
|
}
|
||||||
c -> hey.b
|
c -> hey.b
|
||||||
hey.a -> c
|
hey.a -> c
|
||||||
|
hey -> hey.a
|
||||||
|
|
||||||
hey -> c: ok
|
hey -> c: ok
|
||||||
`,
|
`,
|
||||||
expErr: `d2/testdata/d2compiler/TestCompile/grid_edge.d2:5:2: edges into grid diagrams are not supported yet
|
expErr: `d2/testdata/d2compiler/TestCompile/grid_edge.d2:5:2: edges into grid diagrams are not supported yet
|
||||||
d2/testdata/d2compiler/TestCompile/grid_edge.d2:6:2: edges into grid diagrams are not supported yet`,
|
d2/testdata/d2compiler/TestCompile/grid_edge.d2:6:2: edges into grid diagrams are not supported yet
|
||||||
|
d2/testdata/d2compiler/TestCompile/grid_edge.d2:7:2: edges into grid diagrams are not supported yet`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "grid_nested",
|
name: "grid_nested",
|
||||||
|
|
|
||||||
|
|
@ -209,7 +209,7 @@ func withoutGridDiagrams(ctx context.Context, g *d2graph.Graph, layout d2graph.L
|
||||||
// simple straight line edge routing between grid objects
|
// simple straight line edge routing between grid objects
|
||||||
for i, e := range g.Edges {
|
for i, e := range g.Edges {
|
||||||
edgeOrder[e.AbsID()] = i
|
edgeOrder[e.AbsID()] = i
|
||||||
if e.Dst.ClosestGridDiagram() != obj {
|
if e.Dst.Parent.ClosestGridDiagram() != obj {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
e.Route = []*geo.Point{e.Src.Center(), e.Dst.Center()}
|
e.Route = []*geo.Point{e.Src.Center(), e.Dst.Center()}
|
||||||
|
|
|
||||||
8
testdata/d2compiler/TestCompile/grid_edge.exp.json
generated
vendored
8
testdata/d2compiler/TestCompile/grid_edge.exp.json
generated
vendored
|
|
@ -3,12 +3,16 @@
|
||||||
"err": {
|
"err": {
|
||||||
"errs": [
|
"errs": [
|
||||||
{
|
{
|
||||||
"range": "d2/testdata/d2compiler/TestCompile/grid_edge.d2,4:1:32-4:11:42",
|
"range": "d2/testdata/d2compiler/TestCompile/grid_edge.d2,4:1:36-4:11:46",
|
||||||
"errmsg": "d2/testdata/d2compiler/TestCompile/grid_edge.d2:5:2: edges into grid diagrams are not supported yet"
|
"errmsg": "d2/testdata/d2compiler/TestCompile/grid_edge.d2:5:2: edges into grid diagrams are not supported yet"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"range": "d2/testdata/d2compiler/TestCompile/grid_edge.d2,5:1:44-5:11:54",
|
"range": "d2/testdata/d2compiler/TestCompile/grid_edge.d2,5:1:48-5:11:58",
|
||||||
"errmsg": "d2/testdata/d2compiler/TestCompile/grid_edge.d2:6:2: edges into grid diagrams are not supported yet"
|
"errmsg": "d2/testdata/d2compiler/TestCompile/grid_edge.d2:6:2: edges into grid diagrams are not supported yet"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"range": "d2/testdata/d2compiler/TestCompile/grid_edge.d2,6:1:60-6:13:72",
|
||||||
|
"errmsg": "d2/testdata/d2compiler/TestCompile/grid_edge.d2:7:2: edges into grid diagrams are not supported yet"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue