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

Following up on a request to properly support the opacity parameter. #27

Closed grhowes closed 7 years ago

grhowes commented 7 years ago

@ryanholden8 how about this?

grhowes commented 7 years ago

Have a look at https://github.com/GenerallyHelpfulSoftware/SVGgh/pull/27

ryanholden8 commented 7 years ago

Hi Glen,

Good catch! This implementation though does not seem render any opacity for me, I'll try to look into it further tomorrow. Until then, here are some test files that should test the opacity parameter well. - Opacity-test.zip

grhowes commented 7 years ago

OK, this should work.

ryanholden8 commented 7 years ago

@grhowes This is rendering great for me! It doesn't pass the last test in opacity-test.zip where the last box should not have any red show through the white box but to support that I think would be rather complicated and this opacity support should work for most situations.

BTW - Thank you for your responsiveness on this project. It makes me want to contribute more.

grhowes commented 7 years ago

I'm wondering if CGContextBeginTransparencyLayer could be used to do the effect in that test. It's a toughy that's for sure. Anyway, thanks for bringing this to my attention. I appreciate it greatly and please do let me know if you find anything else.

grhowes commented 7 years ago

@ryanholden8 This seems to satisfy all 3 rectangles in your test case. I'll clean it up before putting it into the main line.