meyfa / php-svg

Vector graphics (SVG) library for PHP
https://packagist.org/packages/meyfa/php-svg
MIT License
509 stars 91 forks source link

fix: Allow renderer short-circuit if unable to render anything #200

Closed meyfa closed 1 year ago

meyfa commented 1 year ago

The text renderer would previously throw in some circumstances if no font was available. With this patch, its prepareRenderParams() method can return null in these cases, aborting the render for that text element without causing a crash.

This also simplifies RectRenderer, which doesn't need an "empty" state anymore.