Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7e247f6

Browse files
committed
[3014606] fix set_alpha in backend_cairo
svn path=/trunk/matplotlib/; revision=8412
1 parent 39cdb96 commit 7e247f6

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

lib/matplotlib/backends/backend_cairo.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ def convert_path(ctx, path, transform):
140140

141141

142142
def draw_path(self, gc, path, transform, rgbFace=None):
143-
if len(path.vertices) > 18980:
144-
raise ValueError("The Cairo backend can not draw paths longer than 18980 points.")
143+
if len(path.vertices) > 18980:
144+
raise ValueError("The Cairo backend can not draw paths longer than 18980 points.")
145145

146146
ctx = gc.ctx
147147

@@ -315,9 +315,10 @@ def restore(self):
315315

316316

317317
def set_alpha(self, alpha):
318-
self._alpha = alpha
318+
GraphicsContextBase.set_alpha(self, alpha)
319+
_alpha = self.get_alpha()
319320
rgb = self._rgb
320-
self.ctx.set_source_rgba (rgb[0], rgb[1], rgb[2], alpha)
321+
self.ctx.set_source_rgba (rgb[0], rgb[1], rgb[2], _alpha)
321322

322323

323324
#def set_antialiased(self, b):

0 commit comments

Comments
 (0)