Some SVGs have fractional pixel bounding boxes, which we can safely
round up without the user noticing anything. In addition, previously
this code would use the width (x2) as both the height and width of the
bounding-box -- this is also rectified.
This is a rebase and re-application of commit d79c8a28764d ("svg:
improve bbox handling of generated PDF") which was accidentally reverted
by commit 80bf42ed74ad ("Reapply: "svg: implement std Error for
SvgParseError").
Some SVGs have fractional pixel bounding boxes, which we can safely round up without the user noticing anything. In addition, previously this code would use the width (x2) as both the height and width of the bounding-box -- this is also rectified.
This is a rebase and re-application of commit d79c8a28764d ("svg: improve bbox handling of generated PDF") which was accidentally reverted by commit 80bf42ed74ad ("Reapply: "svg: implement std Error for SvgParseError").
Signed-off-by: Aleksa Sarai cyphar@cyphar.com