graflow: small fix for loop always bezier

This commit is contained in:
STEINNI
2026-03-02 20:37:58 +00:00
parent e46ff1a817
commit bc6a02fe10
2 changed files with 9 additions and 9 deletions
+6 -6
View File
@@ -8,12 +8,12 @@
<body>
<ul>
<li><a href="./test1.html">test1 (P42 graph + ISOLATED + 2 depths subflows)</a></li>
<li><a href="./test2.html">test2 (organigram) + ISOLATED</a></li>
<li><a href="./test3.html">test3 (EIC simple + subflow + NON-ISOLATED)</a></li>
<li><a href="./test4.html">test4 (EIC-ICMP + NON-ISOLATED)</a></li>
<li><a href="./test4.5.html">test4.5 (EIC-ICMP + NON-ISOLATED + single-port)</a></li>
<li><a href="./test5.html">test5 (P42 graph + ISOLATED + EDITABLE)</a></li>
<li><a target="test1" href="./test1.html">test1 (P42 graph + ISOLATED + 2 depths subflows)</a></li>
<li><a target="test2" href="./test2.html">test2 (organigram) + ISOLATED</a></li>
<li><a target="test3" href="./test3.html">test3 (EIC simple + subflow + NON-ISOLATED)</a></li>
<li><a target="test4" href="./test4.html">test4 (EIC-ICMP + NON-ISOLATED)</a></li>
<li><a target="test4.5" href="./test4.5.html">test4.5 (EIC-ICMP + NON-ISOLATED + single-port, ortho, oriented, aligned top)</a></li>
<li><a target="test5" href="./test5.html">test5 (P42 graph + ISOLATED + EDITABLE)</a></li>
</ul>
</body>
</html>
+3 -3
View File
@@ -495,13 +495,13 @@ class BZgraflow extends Buildoz{
}
}
if(wireType === 'bezier') {
if((wireType === 'bezier') || loop) { // loops only use bezier to look good
return(`M ${x1} ${y1} C ${c1x} ${c1y}, ${c2x} ${c2y}, ${x2} ${y2}`)
}
if(wireType === 'straight') {
if((wireType === 'straight') && (!loop)) {
return(`M ${x1} ${y1} L ${c1x} ${c1y} L ${c2x} ${c2y} L ${x2} ${y2}`)
}
if(wireType === 'ortho') {
if((wireType === 'ortho') && (!loop)) {
let path = `M ${x1} ${y1} `
if(['n', 's'].includes(port1.direction)) {
path += `V ${(c1y+c2y)/2} H ${c2x} V ${y2}`