Skip to content

Commit 0548ce7

Browse files
committed
fix interesting instability in tests
1 parent a93fc65 commit 0548ce7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/draw.typ

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@
256256
// Choose label anchor based on edge direction,
257257
// preferring to place labels above the edge
258258
if edge.label-side == auto {
259-
edge.label-side = if calc.abs(θ) < 90deg { left } else { right }
259+
// edges are often exactly vertical, but tiny floating point errors make θ unstable
260+
// so choose 90.5deg to avoid flickering
261+
edge.label-side = if calc.abs(θ) < 90.5deg { left } else { right }
260262
}
261263

262264
place-edge-label-on-curve(edge, curve, debug: debug)

0 commit comments

Comments
 (0)