You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems to me that the goal of toSVG() is to replicate the current view of the canvas, including its zoom level, and because of that, setZoom() impacts SVG viewBox in the output.
The problem is, if setBackgroundcolor() is used, the background element stays the same size, regardless of the zoom level, so for cases that zoom is less than 1, the SVG output looks different that canvas view (background is small): http://jsfiddle.net/Da7SP/1127/
Canvas view:
SVG View:
A related issue is, if user sets a custom viewBox for SVG output, the background color won't be extended all the way to the edge of the viewBox.
If confirmed as a bug, I think the easiest fix is to change width and height of background to 100%, so both of the above use cases will be covered.
It seems to me that the goal of toSVG() is to replicate the current view of the canvas, including its zoom level, and because of that, setZoom() impacts SVG viewBox in the output.
The problem is, if setBackgroundcolor() is used, the background element stays the same size, regardless of the zoom level, so for cases that zoom is less than 1, the SVG output looks different that canvas view (background is small):
http://jsfiddle.net/Da7SP/1127/
Canvas view:

SVG View:

A related issue is, if user sets a custom viewBox for SVG output, the background color won't be extended all the way to the edge of the viewBox.
If confirmed as a bug, I think the easiest fix is to change width and height of background to 100%, so both of the above use cases will be covered.
<rect x="0" y="0" width="100%" height="100%" fill="red"></rect>
The text was updated successfully, but these errors were encountered: