BigBadaboom / androidsvg

SVG rendering library for Android
http://bigbadaboom.github.io/androidsvg/
Apache License 2.0
1.19k stars 226 forks source link

Incorrect svg rendering. #249

Closed thejask closed 2 years ago

thejask commented 2 years ago

Describe the bug It is noticed that some svg files are not rendered correctly on android device by COIL library. We tried with both v2.0.0 and v2.1.0. And same svg file renders fine on browser (Chrome and Mozilla).

Note : Originally, this issue was reported at android COIL library github, but they suggested it to be reported here. #1291

To Reproduce

Expected behavior It should render correctly.

SVG file share

Screenshots android_screenshot

Additional context Note : same svg file renders fine on browsers like Chrome and Mozilla. Using android COIL library version v2.1.0, v2.0.0

BigBadaboom commented 2 years ago

Interesting. It's been a long time since I've had a path parsing/rendering bug. Thanks for the report.

BigBadaboom commented 2 years ago

Fixed in 1ad1c08c4f7ee09fcdd3dca31f8f31db7cacd3b0.

S/s and T/t path commands were not being handled correctly if they were preceded by a V/v or H/h command. The cause was due to the lastControlX/lastControlY variables not being updated correctly in the V/v/H/h command handling.

This fix will appear in the next release version (1.5).

BigBadaboom commented 2 years ago

@thejask Incidentally, did you realise that you are clipping the bottom of your icon? The height should be 38 to include the whole of the bottom line.

thejask commented 2 years ago

Thanks @BigBadaboom.

ggrell commented 2 years ago

Thanks for the fix @BigBadaboom! who's awesome