- From: Simon Sarris via GitHub <sysbot+gh@w3.org>
- Date: Wed, 01 Apr 2020 22:21:33 +0000
- To: public-svg-issues@w3.org
`drawImage()` with more params doesn't only allow you to clip an image, it allows you to scale the X and Y. [This bug](https://bugzilla.mozilla.org/show_bug.cgi?id=1547776) gives a visual example of how Firefox is doing things differently with respect to Canvas' `drawImage()`. As a JavaScript author, I find the Chrome way of doing things more useful: If I want to draw some image (_regardless_ of the source, `jpeg`, `png`, `svg`) scaled along one axis but not the other, I can do so by using the `drawImage()` arguments. If I want to preserve the aspect ratio, I can do that with the arguments too. But Firefox forces me to preserve the aspect ratio when I'm explicitly trying not to with the args. Of course, I can take the extra step and call `scale()` before and after the call to `drawImage()`, so its not as if its a killer bug, but it **does** introduce an inconsistency in many JavaScript libraries that might use `drawImage()` because if the source is a PNG and a user swaps it out for a seemingly equivalent SVG, suddenly the aspect ratio of the image presented will be different. I would think, as an author, that the ideal is for `drawImage()` to render consistently across all image types it supports, and not differently only for SVG in this way. -- GitHub Notification of comment by simonsarris Please view or discuss this issue at https://github.com/w3c/svgwg/issues/762#issuecomment-607518891 using your GitHub account
Received on Wednesday, 1 April 2020 22:21:35 UTC