8000 Fix #6794: Clipping rectangle needs to be inverted · matplotlib/matplotlib@0315c22 · 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 0315c22

Browse files
committed
Fix #6794: Clipping rectangle needs to be inverted
1 parent aeed94b commit 0315c22

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/_backend_agg.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -738,14 +738,14 @@ inline void RendererAgg::draw_text_image(GCAgg &gc, ImageArray &image, int x, in
738738
typedef agg::renderer_scanline_aa<renderer_base, color_span_alloc_type, span_gen_type>
739739
renderer_type;
740740

741+
theRasterizer.reset_clipping();
742+
rendererBase.reset_clipping(true);
741743
if (angle != 0.0) {
742744
agg::rendering_buffer srcbuf(
743745
image.data(), (unsigned)image.dim(1),
744746
(unsigned)image.dim(0), (unsigned)image.dim(1));
745747
agg::pixfmt_gray8 pixf_img(srcbuf);
746748

747-
theRasterizer.reset_clipping();
748-
rendererBase.reset_clipping(true);
749749
set_clipbox(gc.cliprect, theRasterizer);
750750

751751
agg::trans_affine mtx;
@@ -786,9 +786,9 @@ inline void RendererAgg::draw_text_image(GCAgg &gc, ImageArray &image, int x, in
786786
agg::rect_i clip;
787787

788788
clip.init(int(mpl_round(gc.cliprect.x1)),
789-
int(mpl_round(gc.cliprect.y1)),
789+
int(mpl_round(height - gc.cliprect.y2)),
790790
int(mpl_round(gc.cliprect.x2)),
791-
int(mpl_round(gc.cliprect.y2)));
791+
int(mpl_round(height - gc.cliprect.y1)));
792792
text.clip(clip);
793793
}
794794

0 commit comments

Comments
 (0)
0