@@ -174,15 +174,15 @@ def RenderToGC(self, ctx, scale=None, size=None):
174174 ctx .Scale (sx , sy )
175175
176176 for shape in self .shapes :
177- if not shape .flags & SVG_FLAGS_VISIBLE :
177+ if not shape .flags & SVGflags . SVG_FLAGS_VISIBLE :
178178 continue
179179 if shape .opacity != 1.0 :
180180 ctx .BeginLayer (shape .opacity )
181181 brush = self ._makeBrush (ctx , shape )
182182 pen = self ._makePen (ctx , shape )
183183
184- rule = { SVG_FILLRULE_NONZERO : wx .WINDING_RULE ,
185- SVG_FILLRULE_EVENODD : wx .ODDEVEN_RULE }.get (shape .fillRule , 0 )
184+ rule = { SVGfillRule . SVG_FILLRULE_NONZERO : wx .WINDING_RULE ,
185+ SVGfillRule . SVG_FILLRULE_EVENODD : wx .ODDEVEN_RULE }.get (shape .fillRule , 0 )
186186
187187 # The shape's path is comprised of one or more subpaths, collect
188188 # and accumulate them in a new GraphicsPath
@@ -237,16 +237,16 @@ def _makeBrush(self, ctx, shape):
237237 # set up a brush from the shape.fill (SVGpaint) object
238238
239239 # no brush
240- if shape .fill .type == SVG_PAINT_NONE :
240+ if shape .fill .type == SVGpaintType . SVG_PAINT_NONE :
241241 brush = wx .NullGraphicsBrush
242242
243243 # brush with a solid color
244- elif shape .fill .type == SVG_PAINT_COLOR :
244+ elif shape .fill .type == SVGpaintType . SVG_PAINT_COLOR :
245245 r ,g ,b ,a = shape .fill .color_rgba
246246 brush = ctx .CreateBrush (wx .Brush (wx .Colour (r ,g ,b ,a )))
247247
248248 # brush with a linear gradient
249- elif shape .fill .type == SVG_PAINT_LINEAR_GRADIENT :
249+ elif shape .fill .type == SVGpaintType . SVG_PAINT_LINEAR_GRADIENT :
250250 # NanoSVG gives gradients their own transform which normalizes the
251251 # linear gradients to go from (0, 0) to (0,1) in the transformed
252252 # space. So once we have the transform set we can use those points
@@ -271,7 +271,7 @@ def _makeBrush(self, ctx, shape):
271271 brush = ctx .CreateLinearGradientBrush (x1 ,y1 , x2 ,y2 , stops , matrix )
272272
273273 # brush with a radial gradient
274- elif shape .fill .type == SVG_PAINT_RADIAL_GRADIENT :
274+ elif shape .fill .type == SVGpaintType . SVG_PAINT_RADIAL_GRADIENT :
275275 # Likewise, NanoSVG normalizes radial gradients with a transform
276276 # that puts the center (cx, cy) at (0,0) and the radius has a length
277277 # of 1.
@@ -299,24 +299,24 @@ def _makeBrush(self, ctx, shape):
299299 def _makePen (self , ctx , shape ):
300300 # set up a pen from the shape.stroke (SVGpaint) object
301301 width = shape .strokeWidth
302- join = { SVG_JOIN_MITER : wx .JOIN_MITER ,
303- SVG_JOIN_ROUND : wx .JOIN_ROUND ,
304- SVG_JOIN_BEVEL : wx .JOIN_BEVEL }.get (shape .strokeLineJoin , 0 )
305- cap = { SVG_CAP_BUTT : wx .CAP_BUTT ,
306- SVG_CAP_ROUND : wx .CAP_ROUND ,
307- SVG_CAP_SQUARE : wx .CAP_PROJECTING }.get (shape .strokeLineCap , 0 )
302+ join = { SVGlineJoin . SVG_JOIN_MITER : wx .JOIN_MITER ,
303+ SVGlineJoin . SVG_JOIN_ROUND : wx .JOIN_ROUND ,
304+ SVGlineJoin . SVG_JOIN_BEVEL : wx .JOIN_BEVEL }.get (shape .strokeLineJoin , 0 )
305+ cap = { SVGlineCap . SVG_CAP_BUTT : wx .CAP_BUTT ,
306+ SVGlineCap . SVG_CAP_ROUND : wx .CAP_ROUND ,
307+ SVGlineCap . SVG_CAP_SQUARE : wx .CAP_PROJECTING }.get (shape .strokeLineCap , 0 )
308308 # TODO: handle dashes
309309
310310 info = wx .GraphicsPenInfo (wx .BLACK ).Width (width ).Join (join ).Cap (cap )
311311
312- if shape .stroke .type == SVG_PAINT_NONE :
312+ if shape .stroke .type == SVGpaintType . SVG_PAINT_NONE :
313313 pen = wx .NullGraphicsPen
314314
315- elif shape .stroke .type == SVG_PAINT_COLOR :
315+ elif shape .stroke .type == SVGpaintType . SVG_PAINT_COLOR :
316316 info .Colour (shape .stroke .color_rgba )
317317 pen = ctx .CreatePen (info )
318318
319- elif shape .stroke .type == SVG_PAINT_LINEAR_GRADIENT :
319+ elif shape .stroke .type == SVGpaintType . SVG_PAINT_LINEAR_GRADIENT :
320320 x1 , y1 , = (0.0 , 0.0 )
321321 x2 , y2 , = (0.0 , 1.0 )
322322 gradient = shape .stroke .gradient
@@ -333,7 +333,7 @@ def _makePen(self, ctx, shape):
333333 info .LinearGradient (x1 ,y1 , x2 ,y2 , stops , matrix )
334334 pen = ctx .CreatePen (info )
335335
336- elif shape .stroke .type == SVG_PAINT_RADIAL_GRADIENT :
336+ elif shape .stroke .type == SVGpaintType . SVG_PAINT_RADIAL_GRADIENT :
337337 cx , cy = (0.0 , 0.0 )
338338 radius = 1
339339 gradient = shape .stroke .gradient
0 commit comments