svg icon indicating copy to clipboard operation
svg copied to clipboard

SVG gets rendered horribly wrong

Open Gulvan0 opened this issue 2 years ago • 3 comments

Describe the bug The contours of a simplistic black-and-white SVG get heavily distorted on rendering, though the general shape is still somewhat recognizable. As if some of the key points of the Bezier curves are misplaced (and some aren't). Favicon is also affected by this bug.

To Reproduce Just launch the app

Expected behavior Shape rendered by openfl and shape rendered by browser when the SVG file itself is opened should look the same

Screenshots Original image (tested in latest Chrome & Maxthon): image

Result in OpenFL: image image

Environment Target: html5 Haxe version: 4.2.4 Libraries:

lime 7.9.0
openfl latest git (bug is present even for stable 9.1.0)
svg latest git (bug is present even for stable 1.1.3)

Additional details <icon> tag can be removed from project.xml, it doesn't affect anything. It is there just to demonstrate that this effect is present even for the favicon. This bug forced me to try unchecking "Make Adaptive" and choosing "Presentation Attributes" style preference in the Adobe Illustrator SVG export options. The attached archive is the final version of the repro. Still, the bug is there for the default export settings too.

Testing.zip

Gulvan0 avatar Mar 24 '22 20:03 Gulvan0

After some trial and error, I concluded that the cause of this bug is a faulty relative path commands processing. Still unsure whether this is due to the accumulated floating-point error or some specific commands lead to the wrong results.

Gulvan0 avatar Mar 25 '22 21:03 Gulvan0