vectorgraphics / asymptote

2D & 3D TeX-Aware Vector Graphics Language
https://asymptote.sourceforge.io/
GNU General Public License v3.0
547 stars 90 forks source link

Fixed runtime error when drawing degenerate path with TexHead arrow. #308

Closed jsenn closed 1 year ago

jsenn commented 2 years ago

Currently running draw((0, 0) -- (0, 0), arrow=Arrow(TeXHead)) triggers a runtime error, whereas draw((0, 0) -- (0, 0), arrow=Arrow) succeeds. This is due to a degrees() call that doesn't suppress warnings. Here, the warnings are suppressed so that the TeXHead version works.

Note that the appearance of the TeXHead arrow on a degenerate path with this change is different from the other arrowheads: the former shows up as normal, pointing right, whereas the latter all show up as a dot. This is due to the static sizing of the TeXHead arrowhead.

johncbowman commented 1 year ago

Thanks; fixed in ee0d1a4a80ff0b30383f297f3ab64bebafd1c07c.