edge case
This commit is contained in:
parent
568742e50a
commit
098fc96bd9
5 changed files with 13 additions and 4 deletions
|
|
@ -152,5 +152,14 @@ func boundingBox(g *d2graph.Graph) (tl, br *geo.Point) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if math.IsInf(x1, 1) && math.IsInf(x2, -1) {
|
||||||
|
x1 = 0
|
||||||
|
x2 = 0
|
||||||
|
}
|
||||||
|
if math.IsInf(y1, 1) && math.IsInf(y2, -1) {
|
||||||
|
y1 = 0
|
||||||
|
y2 = 0
|
||||||
|
}
|
||||||
|
|
||||||
return geo.NewPoint(x1, y1), geo.NewPoint(x2, y2)
|
return geo.NewPoint(x1, y1), geo.NewPoint(x2, y2)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
e2etests/testdata/stable/near-alone/dagre/board.exp.json
generated
vendored
2
e2etests/testdata/stable/near-alone/dagre/board.exp.json
generated
vendored
|
|
@ -87,7 +87,7 @@
|
||||||
"type": "",
|
"type": "",
|
||||||
"pos": {
|
"pos": {
|
||||||
"x": -189,
|
"x": -189,
|
||||||
"y": 0
|
"y": -63
|
||||||
},
|
},
|
||||||
"width": 112,
|
"width": 112,
|
||||||
"height": 126,
|
"height": 126,
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ width="450" height="496" viewBox="-291 -248 450 496"><style type="text/css">
|
||||||
svgEl.setAttribute("height", height * ratio - 16);
|
svgEl.setAttribute("height", height * ratio - 16);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
]]></script><g id="x"><g class="shape" ><rect x="-56" y="-146" width="113" height="126" style="fill:#F7F8FE;stroke:#0D32B2;stroke-width:2;" /></g><text class="text-bold" x="0.500000" y="-80.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">x</text></g><g id="y"><g class="shape" ><rect x="-57" y="20" width="114" height="126" style="fill:#F7F8FE;stroke:#0D32B2;stroke-width:2;" /></g><text class="text-bold" x="0.000000" y="86.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">y</text></g><g id="z"><g class="shape" ><rect x="-189" y="0" width="112" height="126" style="fill:#F7F8FE;stroke:#0D32B2;stroke-width:2;" /></g><text class="text-bold" x="-133.000000" y="66.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">z</text></g><mask id="358045695" maskUnits="userSpaceOnUse" x="-100" y="-100" width="450" height="496">
|
]]></script><g id="x"><g class="shape" ><rect x="-56" y="-146" width="113" height="126" style="fill:#F7F8FE;stroke:#0D32B2;stroke-width:2;" /></g><text class="text-bold" x="0.500000" y="-80.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">x</text></g><g id="y"><g class="shape" ><rect x="-57" y="20" width="114" height="126" style="fill:#F7F8FE;stroke:#0D32B2;stroke-width:2;" /></g><text class="text-bold" x="0.000000" y="86.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">y</text></g><g id="z"><g class="shape" ><rect x="-189" y="-63" width="112" height="126" style="fill:#F7F8FE;stroke:#0D32B2;stroke-width:2;" /></g><text class="text-bold" x="-133.000000" y="3.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">z</text></g><mask id="1584545407" maskUnits="userSpaceOnUse" x="-100" y="-100" width="450" height="496">
|
||||||
<rect x="-100" y="-100" width="450" height="496" fill="white"></rect>
|
<rect x="-100" y="-100" width="450" height="496" fill="white"></rect>
|
||||||
|
|
||||||
</mask><style type="text/css"><![CDATA[
|
</mask><style type="text/css"><![CDATA[
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 325 KiB After Width: | Height: | Size: 325 KiB |
2
e2etests/testdata/stable/near-alone/elk/board.exp.json
generated
vendored
2
e2etests/testdata/stable/near-alone/elk/board.exp.json
generated
vendored
|
|
@ -87,7 +87,7 @@
|
||||||
"type": "",
|
"type": "",
|
||||||
"pos": {
|
"pos": {
|
||||||
"x": -189,
|
"x": -189,
|
||||||
"y": 0
|
"y": -63
|
||||||
},
|
},
|
||||||
"width": 112,
|
"width": 112,
|
||||||
"height": 126,
|
"height": 126,
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ width="450" height="496" viewBox="-291 -248 450 496"><style type="text/css">
|
||||||
svgEl.setAttribute("height", height * ratio - 16);
|
svgEl.setAttribute("height", height * ratio - 16);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
]]></script><g id="x"><g class="shape" ><rect x="-56" y="-146" width="113" height="126" style="fill:#F7F8FE;stroke:#0D32B2;stroke-width:2;" /></g><text class="text-bold" x="0.500000" y="-80.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">x</text></g><g id="y"><g class="shape" ><rect x="-57" y="20" width="114" height="126" style="fill:#F7F8FE;stroke:#0D32B2;stroke-width:2;" /></g><text class="text-bold" x="0.000000" y="86.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">y</text></g><g id="z"><g class="shape" ><rect x="-189" y="0" width="112" height="126" style="fill:#F7F8FE;stroke:#0D32B2;stroke-width:2;" /></g><text class="text-bold" x="-133.000000" y="66.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">z</text></g><mask id="358045695" maskUnits="userSpaceOnUse" x="-100" y="-100" width="450" height="496">
|
]]></script><g id="x"><g class="shape" ><rect x="-56" y="-146" width="113" height="126" style="fill:#F7F8FE;stroke:#0D32B2;stroke-width:2;" /></g><text class="text-bold" x="0.500000" y="-80.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">x</text></g><g id="y"><g class="shape" ><rect x="-57" y="20" width="114" height="126" style="fill:#F7F8FE;stroke:#0D32B2;stroke-width:2;" /></g><text class="text-bold" x="0.000000" y="86.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">y</text></g><g id="z"><g class="shape" ><rect x="-189" y="-63" width="112" height="126" style="fill:#F7F8FE;stroke:#0D32B2;stroke-width:2;" /></g><text class="text-bold" x="-133.000000" y="3.000000" style="text-anchor:middle;font-size:16px;fill:#0A0F25">z</text></g><mask id="1584545407" maskUnits="userSpaceOnUse" x="-100" y="-100" width="450" height="496">
|
||||||
<rect x="-100" y="-100" width="450" height="496" fill="white"></rect>
|
<rect x="-100" y="-100" width="450" height="496" fill="white"></rect>
|
||||||
|
|
||||||
</mask><style type="text/css"><![CDATA[
|
</mask><style type="text/css"><![CDATA[
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 325 KiB After Width: | Height: | Size: 325 KiB |
Loading…
Reference in a new issue