@@ -759,16 +759,6 @@ def _draw_ps(self, ps, gc, rgbFace, fill=True, stroke=True, command=None):
759759 fill = (fill and rgbFace is not None and
760760 (len (rgbFace ) <= 3 or rgbFace [3 ] != 0.0 ))
761761
762- if stroke :
763- self .set_linewidth (gc .get_linewidth ())
764- jint = gc .get_joinstyle ()
765- self .set_linejoin (jint )
766- cint = gc .get_capstyle ()
767- self .set_linecap (cint )
768- self .set_linedash (* gc .get_dashes ())
769- if self .linewidth > 0 and stroke :
770- self .set_color (* gc .get_rgb ()[:3 ])
771-
772762 cliprect = gc .get_clip_rectangle ()
773763 if cliprect :
774764 x ,y ,w ,h = cliprect .bounds
@@ -782,17 +772,23 @@ def _draw_ps(self, ps, gc, rgbFace, fill=True, stroke=True, command=None):
782772 write (ps .strip ())
783773 write ("\n " )
784774
775+ hatch = gc .get_hatch ()
776+ if hatch :
777+ self .set_hatch (hatch )
778+
785779 if fill :
786780 #print 'rgbface', rgbFace
787781 write ("gsave\n " )
788782 self .set_color (store = 0 , * rgbFace [:3 ])
789783 write ("fill\n grestore\n " )
790784
791- hatch = gc .get_hatch ()
792- if (hatch ):
793- self .set_hatch (hatch )
794-
795- if self .linewidth > 0 and stroke :
785+ if stroke and gc .get_linewidth () > 0.0 :
786+ self .set_linewidth (gc .get_linewidth ())
787+ jint = gc .get_joinstyle ()
788+ self .set_linejoin (jint )
789+ cint = gc .get_capstyle ()
790+ self .set_linecap (cint )
791+ self .set_linedash (* gc .get_dashes ())
796792 self .set_color (* gc .get_rgb ()[:3 ])
797793 write ("stroke\n " )
798794 else :
0 commit comments