Draw better circles for circle annotations
Because PDF spec has no built in circle operator, we can only approximate a circle by joining cubic bezier curve segments.
We already did good approximation for line endings and radio buttons by setting distance of bezier control point to (4 * (sqrt(2) - 1) / 3) * r
. But the older AnnotGeometry::draw code for subtype circle still used an equivalent of 0.5 * r
, which yields a visibly non-circular circle. Fix it by using the bezierCircle define for AnnotGeometry too.
Does minor refactoring by introducing AnnotAppearanceBuilder::drawEllipse, and forwarding drawCircle to it.
Fixes #989 (closed).
Visual comparison
old | new |
---|---|
Recorded using
$ pdftoppm -x 145 -y 446 -W 159 -H 158 -f 0 -singlefile -png /ann.pdf ./circle