Details
-
Bug
-
Resolution: Unresolved
-
P4: Low
-
None
-
5.8.0, 5.12.0, 5.15.1, 6.4.1
-
KDE Neon LTS 64bit
Description
Hi, I'm struggling to properly render SVG icons into a Canvas item.
Since icons are small (for me typically 48x48px), I always use the sourceSize property to force a specific rendering size.
On a Canvas though, it seems the drawImage call completely ignores the rasterization size and somehow scale the original SVG size to the requested one (dw, dh), producing an ugly aliasing effect which makes the usage of the SVG format totally useless.
Attached a self contained example to reproduce the issue and a screenshot of the result.
From the left:
- the original SVG icon as Image item (correct)
- the same Image item rendered by drawImage (to be honest I expected this to be correct as well, since rasterized data should be provided by Image)
- the SVG icon loaded with the procedure explained in the documentation, with loadImage and onImageLoaded
Is there any trick to solve this that I'm not aware of or is there something wrong in the internals ?