While researching the correct fix for #18 , I read through a helpful description of how SVG handles the viewBox attribute here: http://tutorials.jenkov.com/svg/svg-viewport-view-box.html
viewBox defines an internal coordinate system which gets transformed into the parent coordinate system by a combination of width, height, and preserveAspectRatio properties.
JAVSVGParser currently ignores the SVG width and height attributes entirely, which makes the viewBox attribute meaningless when it is not equally sized to width and height. Currently viewBox origin is respected, but its size relative to the SVG width and height is not.
I believe the correct-ish behaviour is, in the SVG handling of JAMSVGParser:
- Read
width and height
- Read
preserveAspectRatio
- Read
viewBox
- Image
size is determined exclusively by width and height.
- Path transformation is determined by combination of all of those attributes.
While researching the correct fix for #18 , I read through a helpful description of how SVG handles the
viewBoxattribute here: http://tutorials.jenkov.com/svg/svg-viewport-view-box.htmlviewBoxdefines an internal coordinate system which gets transformed into the parent coordinate system by a combination ofwidth,height, andpreserveAspectRatioproperties.JAVSVGParsercurrently ignores the SVGwidthandheightattributes entirely, which makes theviewBoxattribute meaningless when it is not equally sized towidthandheight. CurrentlyviewBoxorigin is respected, but its size relative to the SVGwidthandheightis not.I believe the correct-ish behaviour is, in the SVG handling of
JAMSVGParser:widthandheightpreserveAspectRatioviewBoxsizeis determined exclusively bywidthandheight.