MaddTheSane/SVGKit — pull request #11 by DigitalExegete (2014-12-21 20:32:44+00:00)
Title: Fixing SVGGradientLayer display and -renderInContext:

Some SVG images I am using have a Gradient to make some screws look a little more realistic, and so I tried to figure out why the gradients weren't showing up when displayed on screen, and when rendered.

As far as being displayed on screen, the gradients weren't being scaled using the viewport, but only the view box. This meant that the SVGGradientLayers were never shrunk to the same size as the use may have inputed when setting the SVGKImage's size.

When it was time for the SVGGradientLayer to be rendered in -renderInContext:, it seems that the layer.mask property was interfering with the rendering process.

I've attached two images to show the results. The first a crop of the graphic that I'm using as it's displayed on screen. The second is the image in a PDF that was drawn using -renderInContext:.
![screen shot 2014-12-21 at 14 23 51](https://cloud.githubusercontent.com/assets/7121337/5519505/3fedda20-891d-11e4-95a0-ce490df94be7.png)

![screen shot 2014-12-21 at 14 24 51](https://cloud.githubusercontent.com/assets/7121337/5519504/3fd7e3be-891d-11e4-9059-726791043dc9.png)