Commit 474bb4f
committed
Agg: Fix overflow when splitting large lines
For very large Figures with a single Axes, the horizontal spines may be
long enough to need splitting into separate lines. For large enough
coordinates, the `x1+x2` calculation may overflow, flipping the sign
bit, causing the coordinates to become negative. This causes an infinite
loop as some internal condition is never met.
By dividing `x1`/`x2` by 2 first, we avoid the overflow, and can
calculate the split point correctly.1 parent 7d73e2a commit 474bb4f
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
328 | | - | |
329 | | - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
330 | 332 | | |
331 | 333 | | |
332 | 334 | | |
| |||
0 commit comments