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

Skip to content

Commit 87bdb63

Browse files
committed
Handle alpha on images in Cairo backend.
1 parent c38a71e commit 87bdb63

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/backends/backend_cairo.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@ def draw_image(self, gc, x, y, im):
177177

178178
ctx.save()
179179
ctx.set_source_surface (surface, x, y)
180-
ctx.paint()
180+
if gc.get_alpha() != 1.0:
181+
ctx.paint_with_alpha(gc.get_alpha())
182+
else:
183+
ctx.paint()
181184
ctx.restore()
182185

183186
im.flipud_out()

0 commit comments

Comments
 (0)