@@ -1141,12 +1141,12 @@ def alphaState(self, alpha):
11411141 def hatchPattern (self , hatch_style ):
11421142 # The colors may come in as numpy arrays, which aren't hashable
11431143 if hatch_style is not None :
1144- face , edge , hatch = hatch_style
1145- if face is not None :
1146- face = tuple (face )
1144+ edge , face , hatch = hatch_style
11471145 if edge is not None :
11481146 edge = tuple (edge )
1149- hatch_style = (face , edge , hatch )
1147+ if face is not None :
1148+ face = tuple (face )
1149+ hatch_style = (edge , face , hatch )
11501150
11511151 pattern = self .hatchPatterns .get (hatch_style , None )
11521152 if pattern is not None :
@@ -1171,7 +1171,9 @@ def writeHatches(self):
11711171 'PatternType' : 1 , 'PaintType' : 1 , 'TilingType' : 1 ,
11721172 'BBox' : [0 , 0 , sidelen , sidelen ],
11731173 'XStep' : sidelen , 'YStep' : sidelen ,
1174- 'Resources' : res })
1174+ 'Resources' : res ,
1175+ # Change origin to match Agg at top-left.
1176+ 'Matrix' : [1 , 0 , 0 , 1 , 0 , self .height * 72 ]})
11751177
11761178 stroke_rgb , fill_rgb , path = hatch_style
11771179 self .output (stroke_rgb [0 ], stroke_rgb [1 ], stroke_rgb [2 ],
@@ -1184,13 +1186,11 @@ def writeHatches(self):
11841186
11851187 self .output (rcParams ['hatch.linewidth' ], Op .setlinewidth )
11861188
1187- # TODO: We could make this dpi-dependent, but that would be
1188- # an API change
11891189 self .output (* self .pathOperations (
11901190 Path .hatch (path ),
11911191 Affine2D ().scale (sidelen ),
11921192 simplify = False ))
1193- self .output (Op .stroke )
1193+ self .output (Op .fill_stroke )
11941194
11951195 self .endStream ()
11961196 self .writeObject (self .hatchObject , hatchDict )
0 commit comments