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

Skip to content

Commit e333c78

Browse files
author
Steve Chaplin
committed
SC
svn path=/trunk/matplotlib/; revision=2981
1 parent 31f9b15 commit e333c78

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2007-01-12 backend_cairo.py: enable clipping. Update draw_image() so that
2+
examples/contour_demo.py looks correct - SC
3+
14
2007-01-12 backend_cairo.py: fix draw_image() so that examples/image_demo.py
25
now looks correct - SC
36

lib/matplotlib/backends/backend_cairo.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ def draw_image(self, x, y, im, bbox):
170170

171171
# function does not pass a 'gc' so use renderer.ctx
172172
ctx = self.ctx
173+
y = self.height - y - rows
173174
ctx.set_source_surface (surface, x, y)
174175
ctx.paint()
175176

@@ -472,11 +473,9 @@ def set_clip_rectangle(self, rectangle):
472473
ctx = self.ctx
473474
ctx.new_path()
474475
ctx.rectangle (x, self.renderer.height - h - y, w, h)
475-
476-
# enabline ctx.clip() causes problems:
477-
# line_styles.py - only see first axes
478-
# simple_plot.py - lose text
479-
#ctx.clip ()
476+
ctx.clip ()
477+
# Alternative: just set _cliprect here and actually set cairo clip rect
478+
# in fill_and_stroke() inside ctx.save() ... ctx.restore()
480479

481480

482481
def set_dashes(self, offset, dashes):

0 commit comments

Comments
 (0)