Skip to content

Commit 6e1d52b

Browse files
committed
svg: try to fix the compilation issues on older Cython
1 parent 015eab6 commit 6e1d52b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

kivy/graphics/svg.pyx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ cdef list kv_color_to_int_color(color):
278278
c = [int(255*x) for x in color]
279279
return c if len(c) == 4 else c + [255]
280280

281-
cdef parse_color(c, current_color = None):
281+
cdef parse_color(c, current_color=None):
282282
cdef int r, g, b, a
283283
if c is None or c == 'none':
284284
return None
@@ -410,9 +410,9 @@ class Gradient(object):
410410
for e in element.getiterator():
411411
if e.tag.endswith('stop'):
412412
style = parse_style(e.get('style', ''))
413-
color = parse_color(e.get('stop-color'), current_color = svg.current_color)
413+
color = parse_color(e.get('stop-color'), svg.current_color)
414414
if 'stop-color' in style:
415-
color = parse_color(style['stop-color'], current_color = svg.current_color)
415+
color = parse_color(style['stop-color'], svg.current_color)
416416
color[3] = int(float(e.get('stop-opacity', '1')) * 255)
417417
if 'stop-opacity' in style:
418418
color[3] = int(float(style['stop-opacity']) * 255)
@@ -646,8 +646,8 @@ cdef class Svg(RenderContext):
646646
self.parse_element(e)
647647

648648
cdef parse_element(self, e):
649-
self.fill = parse_color(e.get('fill'), current_color = self.current_color)
650-
self.stroke = parse_color(e.get('stroke'), current_color = self.current_color)
649+
self.fill = parse_color(e.get('fill'), self.current_color)
650+
self.stroke = parse_color(e.get('stroke'), self.current_color)
651651
oldopacity = self.opacity
652652
self.opacity *= float(e.get('opacity', 1))
653653
fill_opacity = float(e.get('fill-opacity', 1))
@@ -661,11 +661,11 @@ cdef class Svg(RenderContext):
661661
if style:
662662
sdict = parse_style(style)
663663
if 'fill' in sdict:
664-
self.fill = parse_color(sdict['fill'], current_color = self.current_color)
664+
self.fill = parse_color(sdict['fill'], self.current_color)
665665
if 'fill-opacity' in sdict:
666666
fill_opacity *= float(sdict['fill-opacity'])
667667
if 'stroke' in sdict:
668-
self.stroke = parse_color(sdict['stroke'], current_color = self.current_color)
668+
self.stroke = parse_color(sdict['stroke'], self.current_color)
669669
if 'stroke-opacity' in sdict:
670670
stroke_opacity *= float(sdict['stroke-opacity'])
671671

0 commit comments

Comments
 (0)