@@ -61,7 +61,7 @@ def __init__(self, width, height, svgwriter, basename=None):
6161
6262 RendererBase .__init__ (self )
6363 self ._glyph_map = dict ()
64-
64+
6565 svgwriter .write (svgProlog % (width ,height ,width ,height ))
6666
6767 def _draw_svg_element (self , element , details , gc , rgbFace ):
@@ -241,7 +241,8 @@ def _convert_path(self, path, transform, clip=False):
241241
242242 def draw_path (self , gc , path , transform , rgbFace = None ):
243243 trans_and_flip = self ._make_flip_transform (transform )
244- path_data = self ._convert_path (path , trans_and_flip , clip = (rgbFace is None ))
244+ path_data = self ._convert_path (path , trans_and_flip ,
245+ clip = (rgbFace is None and gc .get_hatch_path () is None ))
245246 self ._draw_svg_element ('path' , 'd="%s"' % path_data , gc , rgbFace )
246247
247248 def draw_markers (self , gc , marker_path , marker_trans , path , trans , rgbFace = None ):
@@ -412,7 +413,7 @@ def draw_image(self, gc, x, y, im):
412413
413414 def _adjust_char_id (self , char_id ):
414415 return char_id .replace ("%20" ,"_" )
415-
416+
416417 def draw_text_as_path (self , gc , x , y , s , prop , angle , ismath ):
417418 """
418419 draw the text by converting them to paths using textpath module.
@@ -422,26 +423,26 @@ def draw_text_as_path(self, gc, x, y, s, prop, angle, ismath):
422423
423424 *s*
424425 text to be converted
425-
426+
426427 *usetex*
427428 If True, use matplotlib usetex mode.
428429
429430 *ismath*
430431 If True, use mathtext parser. If "TeX", use *usetex* mode.
431432
432-
433+
433434 """
434435 # this method works for normal text, mathtext and usetex mode.
435436 # But currently only utilized by draw_tex method.
436-
437+
437438 glyph_map = self ._glyph_map
438-
439+
439440 text2path = self ._text2path
440441 color = rgb2hex (gc .get_rgb ()[:3 ])
441442 fontsize = prop .get_size_in_points ()
442443
443444 write = self ._svgwriter .write
444-
445+
445446 if ismath == False :
446447 font = text2path ._get_font (prop )
447448 _glyphs = text2path .get_glyphs_with_font (font , s , glyph_map = glyph_map ,
@@ -460,7 +461,7 @@ def draw_text_as_path(self, gc, x, y, s, prop, angle, ismath):
460461 write ('</defs>\n ' )
461462
462463 glyph_map .update (glyph_map_new )
463-
464+
464465 svg = []
465466 clipid = self ._get_gc_clip_svg (gc )
466467 if clipid is not None :
@@ -508,7 +509,7 @@ def draw_text_as_path(self, gc, x, y, s, prop, angle, ismath):
508509 write ('</defs>\n ' )
509510
510511 glyph_map .update (glyph_map_new )
511-
512+
512513 svg = []
513514 clipid = self ._get_gc_clip_svg (gc )
514515 if clipid is not None :
@@ -800,7 +801,7 @@ def get_text_width_height_descent(self, s, prop, ismath):
800801 w , h , d = texmanager .get_text_width_height_descent (s , fontsize ,
801802 renderer = self )
802803 return w , h , d
803-
804+
804805 if ismath :
805806 width , height , descent , trash , used_characters = \
806807 self .mathtext_parser .parse (s , 72 , prop )
0 commit comments