yWorks / svg2pdf.js

A javascript-only SVG to PDF conversion utility that runs in the browser. Brought to you by yWorks - the diagramming experts
MIT License
643 stars 96 forks source link

Fix <use> with no contents #279

Closed edemaine closed 6 months ago

edemaine commented 7 months ago

Fixes #278 by correctly checking for empty paths in GeometryNode.prototype.getBoundingBoxCore. Indeed, the line mentioned in https://github.com/yWorks/svg2pdf.js/issues/278#issuecomment-1842474779 had a bug that wasn't correctly checking for empty paths.

I've confirmed that this fixes #278 in my setting. I didn't add tests because I don't know how they're organized...

edemaine commented 7 months ago

Sorry about the extra changes in dist and yarn.lock. I didn't mean to include them, but git commit -a is a hard habit to break. 😅

Thanks for the README pointer. I added the test case from #278. If you'd rather a more interesting test (such as a larger output from MathJax where this occurs), or rather it integrated into the existing svg-use example, let me know.

HackbrettXXX commented 6 months ago

I published the bugfix: https://github.com/yWorks/svg2pdf.js/releases/tag/v2.2.3

edemaine commented 6 months ago

I confirmed that the new release fixes my issues. Thank you!!