8000 Updated test images for PDF/SVG alpha handling · matplotlib/matplotlib@1b7fca1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1b7fca1

Browse files
committed
Updated test images for PDF/SVG alpha handling
1 parent e767a41 commit 1b7fca1

File tree

6 files changed

+168
-165
lines changed

6 files changed

+168
-165
lines changed

lib/matplotlib/backends/backend_pdf.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,11 +1294,11 @@ def hatchPattern(self, hatch_style, forced_alpha):
12941294
edge, face, hatch = hatch_style
12951295
if edge is not None:
12961296
edge = tuple(edge)
1297-
if forced_alpha: # reset alpha if forced
1297+
if forced_alpha: # reset alpha if forced
12981298
edge = edge[:3] + (1.0,)
12991299
if face is not None:
13001300
face = tuple(face)
1301-
if forced_alpha: # reset alpha if forced
1301+
if forced_alpha: # reset alpha if forced
13021302
face = face[:3] + (1.0,)
13031303
hatch_style = (edge, face, hatch)
13041304

@@ -2321,12 +2321,14 @@ def clip_cmd(self, cliprect, clippath):
23212321
(('_cliprect', '_clippath'), clip_cmd),
23222322
(('_alpha', '_forced_alpha', '_effective_alphas'), alpha_cmd),
23232323
(('_capstyle',), capstyle_cmd),
2324+
# If you change the next line also fix the check in delta
23242325
(('_fillcolor',), fillcolor_cmd),
23252326
(('_joinstyle',), joinstyle_cmd),
23262327
(('_linewidth',), linewidth_cmd),
23272328
(('_dashes',), dash_cmd),
23282329
(('_rgb',), rgb_cmd),
23292330
# must come after fillcolor and rgb
2331+
# If you change the next line also fix the check in delta
23302332
(('_hatch', '_hatch_color', '_forced_alpha'), hatch_cmd),
23312333
)
23322334

@@ -2356,7 +2358,8 @@ def delta(self, other):
23562358
break
23572359

23582360
# Need to update hatching if we also updated fillcolor
2359-
if params == ('_hatch', '_hatch_color') and fill_performed:
2361+
if (params == ('_hatch', '_hatch_color', '_forced_alpha')
2362+
and fill_performed):
23602363
different = True
23612364

23622365
if different:

lib/matplotlib/backends/backend_svg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,12 +353,12 @@ def _get_hatch(self, gc, rgbFace):
353353
forced_alpha = gc.get_forced_alpha()
354354
if rgbFace is not None:
355355
rgbFace = tuple(rgbFace)
356-
if forced_alpha: # reset alpha if forced
356+
if forced_alpha: # reset alpha if forced
357357
rgbFace = rgbFace[:3] + (1.0,)
358358
edge = gc.get_hatch_color()
359359
if edge is not None:
360360
edge = tuple(edge)
361-
if forced_alpha: # reset alpha if forced
361+
if forced_alpha: # reset alpha if forced
362362
edge = edge[:3] + (1.0,)
363363
dictkey = (gc.get_hatch(), rgbFace, edge, gc.get_forced_alpha())
364364
oid = self._hatchd.get(dictkey)

0 commit comments

Comments
 (0)
0