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

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Squashed three commits into one.
  • Loading branch information
mdehoon committed Nov 28, 2012
commit 8d15940f75b18f51e370ab438bd5ab7e5b8fce17
11 changes: 1 addition & 10 deletions lib/matplotlib/backends/backend_cairo.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,24 +157,15 @@ def draw_image(self, gc, x, y, im):
# bbox - not currently used
if _debug: print '%s.%s()' % (self.__class__.__name__, _fn_name())

clippath, clippath_trans = gc.get_clip_path()

im.flipud_out()

rows, cols, buf = im.color_conv (BYTE_FORMAT)
surface = cairo.ImageSurface.create_for_data (
buf, cairo.FORMAT_ARGB32, cols, rows, cols*4)
# function does not pass a 'gc' so use renderer.ctx
ctx = self.gc.ctx
ctx.save()
if clippath is not None:
ctx.new_path()
RendererCairo.convert_path(ctx, clippath, clippath_trans)
ctx.clip()
ctx = gc.ctx
y = self.height - y - rows
ctx.set_source_surface (surface, x, y)
ctx.paint()
ctx.restore()

im.flipud_out()

Expand Down