Skip to content

Commit 364a2a5

Browse files
committed
backend_pdf: optional rgbFace arg in fillp replaces code in draw_markers
1 parent 2313e90 commit 364a2a5

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

lib/matplotlib/backends/backend_pdf.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,10 +1556,7 @@ def draw_markers(self, gc, marker_path, marker_trans, path, trans, rgbFace=None)
15561556
return
15571557

15581558
self.check_gc(gc, rgbFace)
1559-
if rgbFace:
1560-
fillp = gc.fillp()
1561-
else:
1562-
fillp = None
1559+
fillp = gc.fillp(rgbFace)
15631560
strokep = gc.strokep()
15641561

15651562
output = self.file.output
@@ -2005,13 +2002,20 @@ def strokep(self):
20052002
return (self._linewidth > 0 and self._alpha > 0 and
20062003
(len(self._rgb) <= 3 or self._rgb[3] != 0.0))
20072004

2008-
def fillp(self):
2005+
def fillp(self, *args):
20092006
"""
20102007
Predicate: does the path need to be filled?
2008+
2009+
An optional argument can be used to specify an alternative
2010+
_fillcolor, as needed by RendererPdf.draw_markers.
20112011
"""
2012-
return self._hatch or \
2013-
(self._fillcolor is not None and
2014-
(len(self._fillcolor) <= 3 or self._fillcolor[3] != 0.0))
2012+
if len(args):
2013+
_fillcolor = args[0]
2014+
else:
2015+
_fillcolor = self._fillcolor
2016+
return (self._hatch or
2017+
(_fillcolor is not None and
2018+
(len(_fillcolor) <= 3 or _fillcolor[3] != 0.0)))
20152019

20162020
def close_and_paint(self):
20172021
"""

0 commit comments

Comments
 (0)