dompdf/php-svg-lib

viewbox is not correctly mapped to SVG viewport

bsweeney opened this issue · 0 comments

Per the SVG spec the viewBox "(specifes) a rectangle in user space that should be mapped to the bounds of the SVG viewport established by the given element, taking into account the preserveAspectRatio attribute. The presence of the viewBox attribute results in a transformation being applied to the viewport coordinate system."

Essentially, when the viewBox doesn't match the viewport a transformation is applied. While the x/y values are correctly applied, the width/height do not define a transformation to the viewport.
https://svgwg.org/svg2-draft/coords.html