Open Azervu opened 2 years ago
Seems like a tiny-skia/Skia bug to me.
This is how Skia itself renders it:
A bit different, but still not quite right.
You can actually mitigate it by removing stroke-linecap="square"
I will keep this bug open, but it has nothing to do with resvg, bug rather with tiny-skia. See https://github.com/RazrFalcon/tiny-skia/issues/44
Can confirm the workaround works on the red one, the yellow one hovever turned out to be an aliasing issue.
Edit: issue https://github.com/RazrFalcon/tiny-skia/issues/8 would fix this
Are you sure it relates to analytical anti-aliasing? In Skia, it triggered only in specific cases and I'm not sure it affects your case.
The issue is the path intersecting the sampling points
<svg xmlns="http://www.w3.org/2000/svg" width="23" height="13">
<path d="M3.876 1v2.876H1v1.248h2.876V8h1.248V5.124H8V3.876H5.124V1z" fill="#f00"/>
<path d="M10.875 5v2.875H8v1.25h2.875V12h1.25V9.125H15v-1.25h-2.875V5z" fill="#ff0"/>
<path d="M17.874 1v2.874H15v1.252h2.874V8h1.252V5.126H22V3.874h-2.874V1z" fill="#0f0"/>
</svg>
The red cross is slightly smaller, the green slightly larger.
This test image has some rasterization issues
Result(scale up x8):
Inkscape for comparison:![test_inkscape](https://user-images.githubusercontent.com/2571532/152797412-693447bf-74d7-4469-9267-b68f00fd08a1.png)