GenerallyHelpfulSoftware / SVGgh

A framework for using SVG artwork in iOS Apps. Includes a UIView and a button class, printing and PDF export.
MIT License
141 stars 38 forks source link

iOS 12 Rendering Bug #38

Open ryanholden8 opened 5 years ago

ryanholden8 commented 5 years ago

Hello! We are upgrading to the iOS 12 SDK and have noticed a few SVGs not rendering correctly. We've tried our best to capture good test data, but please let me know if I can help in someway. Not sure how to fix it.

Attached is a zip file of examples.

Here's what has been discovered so far:

  1. example-1.svg is not rendering correctly on iOS 12, but is rendering correctly on iOS 11.
  2. Saw there was a iOS 12 beta patch that was then removed due to Apple fixing one issue. Testing the waters, we re-applied the patch and example-1.svg started rendering correctly on iOS 12 GM. Hurray!
  3. Unfortunately, example-2.svg stopped rendering correctly on iOS 12 & 11. Removing the iOS 12 patch caused it to rendering correctly again.
  4. example-3.svg is a slightly modified version of example-2.svg that works with and without the iOS 12 patch. Not sure why, but we're hoping the slight difference will reveal some information on a good fix.
  5. The issue seems related to the CGPathCloseSubpath function, as you know. I found this open source implementation of the function here on line 399. It's not Apple's implementation but maybe it's helpful, maybe not.

Thank you so much for your time and attention on this! Again, please let me know if there is anything we can do to help.

grhowes commented 5 years ago

I’m at work right now, but will get back to you. I would not recommend using that patch. It was not well tested and broke more than it fixed. I’m surprised to hear there is still a broken problem with the release version of iOS 12.

--glenn Sent from my iPhone

On Oct 5, 2018, at 12:52 PM, Ryan Holden notifications@github.com wrote:

Hello! We are upgrading to the iOS 12 SDK and have noticed a few SVGs not rendering correctly. We've tried our best to capture good test data, but please let me know if I can help in someway. Not sure how to fix it.

Attached is a zip file of examples.

Here's what has been discovered so far:

example-1.svg is not rendering correctly on iOS 12, but is rendering correctly on iOS 11. Saw there was a iOS 12 beta patch that was then removed due to Apple fixing one issue. Testing the waters, we re-applied the patch and example-1.svg started rendering correctly on iOS 12 GM. Hurray! Unfortunately, example-2.svg stopped rendering correctly on iOS 12 & 11. Removing the iOS 12 patch caused it to rendering correctly again. example-3.svg is a slightly modified version of example-2.svg that works with and without the iOS 12 patch. Not sure why, but we're hoping the slight difference will reveal some information on a good fix. The issue seems related to the CGPathCloseSubpath function, as you know. I found this open source implementation of the function here on line 399. It's not Apple's implementation but maybe it's helpful, maybe not. Thank you so much for your time and attention on this! Again, please let me know if there is anything we can do to help.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

grhowes commented 5 years ago

The problem is that the reason I pulled that fix is that it breaks something that I consider more common. There's a checkerboard in the test page in the test app that doesn't render properly with that fix.

grhowes commented 5 years ago

Is it still the case that the problem comes up with a relative move after an arc? I'm wondering if it makes sense to try to replace the calls to add an arc with a bezier.