Skip to content
Permalink
Browse files

a bit more cleanup

  • Loading branch information...
Robin Dunn authored and RobinD42 committed Aug 16, 2019
1 parent c4f30a1 commit a2a2b25d33a4f9113ae43066dd4b4124063c1da9
Showing with 3 additions and 5 deletions.
  1. +2 −4 wx/svg/__init__.py
  2. +1 −1 wx/svg/_nanosvg.c
@@ -249,7 +249,7 @@ def _makeBrush(self, ctx, shape):
# brush with a linear gradient
elif shape.fill.type == SVG_PAINT_LINEAR_GRADIENT:
# NanoSVG gives gradients their own transform which normalizes the
# linear gradiants to go from (0, 0) to (0,1) in the transformed
# linear gradients to go from (0, 0) to (0,1) in the transformed
# space. So once we have the transform set we can use those points
# too.
x1, y1, = (0.0, 0.0)
@@ -266,15 +266,14 @@ def _makeBrush(self, ctx, shape):
matrix.Invert()
x1, y1 = matrix.TransformPoint(x1, y1)
x2, y2 = matrix.TransformPoint(x2, y2)
#print('(x1,y1), (x2,y2):', (x1,y1), (x2,y2))
matrix = wx.NullGraphicsMatrix

stops = self._makeGradientStops(gradient)
brush = ctx.CreateLinearGradientBrush(x1,y1, x2,y2, stops, matrix)

# brush with a radial gradient
elif shape.fill.type == SVG_PAINT_RADIAL_GRADIENT:
# Likewise, NanoSVG normalizes radial gradients with a a transform
# Likewise, NanoSVG normalizes radial gradients with a transform
# that puts the center (cx, cy) at (0,0) and the radius has a length
# of 1.
cx, cy = (0.0, 0.0)
@@ -288,7 +287,6 @@ def _makeBrush(self, ctx, shape):
cx, cy = matrix.TransformPoint(cx, cy)
r1, r2 = matrix.TransformPoint(0, 1)
radius = r2 - cy
#print("(cx, cy) radius:",(cx, cy), radius)
matrix = wx.NullGraphicsMatrix

stops = self._makeGradientStops(gradient)

Some generated files are not rendered by default. Learn more.

0 comments on commit a2a2b25

Please sign in to comment.
You can’t perform that action at this time.