@@ -68,11 +68,14 @@ def _get_font(self, prop):
6868 font .set_size (size , 72.0 )
6969 return font
7070
71+
7172 def _get_gc_props_svg (self , gc ):
7273 color = 'stroke: %s; ' % rgb2hex (gc .get_rgb ())
7374 linewidth = 'stroke-width: %f; ' % gc .get_linewidth ()
74- join = 'stroke-linejoin: %s; ' % gc .get_joinstyle ()
75- cap = 'stroke-linecap: %s; ' % gc .get_capstyle ()
75+ join = 'stroke-linejoin: %s; ' % gc .get_joinstyle ()
76+ cap = 'stroke-linecap: %s; ' % {'projecting' : 'square' ,
77+ 'butt' : 'butt' ,
78+ 'round' : 'round' ,}[gc .get_capstyle ()]
7679 alpha = 'opacity: %f; ' % gc .get_alpha ()
7780 offset , seq = gc .get_dashes ()
7881 if seq is not None :
@@ -82,6 +85,7 @@ def _get_gc_props_svg(self, gc):
8285 dashes = ''
8386 return '%(color)s %(linewidth)s %(join)s %(cap)s %(dashes)s %(alpha)s' % locals ()
8487
88+
8589 def _get_gc_clip_svg (self , gc ):
8690 cliprect = gc .get_clip_rectangle ()
8791 if cliprect is not None :
@@ -240,20 +244,7 @@ def get_text_width_height(self, s, prop, ismath):
240244 h /= 64.0
241245 return w , h
242246
243- def new_gc (self ):
244- return GraphicsContextSVG ()
245-
246247
247- class GraphicsContextSVG (GraphicsContextBase ):
248- def get_capstyle (self ):
249- 'one of butt/round/square/none'
250- d = {'projecting' : 'square' ,
251- 'butt' : 'butt' ,
252- 'round' : 'round' ,
253- }
254- return d [self ._capstyle .lower ()]
255-
256-
257248class FigureCanvasSVG (FigureCanvasBase ):
258249
259250 def print_figure (self , filename , dpi = 80 ,
0 commit comments