8000 Handle alpha on images in Cairo backend. · matplotlib/matplotlib@87bdb63 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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)
0