Skip to content

Commit

Permalink
Don't draw text when it's completely clipped away
Browse files Browse the repository at this point in the history
  • Loading branch information
mdboom committed Nov 7, 2015
1 parent 6910b92 commit ce5fb1f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/_backend_agg.h
Original file line number Diff line number Diff line change
Expand Up @@ -788,9 +788,11 @@ inline void RendererAgg::draw_text_image(GCAgg &gc, ImageArray &image, int x, in
text.clip(clip);
}

for (int yi = text.y1; yi < text.y2; ++yi) {
pixFmt.blend_solid_hspan(text.x1, yi, (text.x2 - text.x1), gc.color,
&image(yi - (y - image.dim(0)), text.x1 - x));
if (text.x2 > text.x1) {
for (int yi = text.y1; yi < text.y2; ++yi) {
pixFmt.blend_solid_hspan(text.x1, yi, (text.x2 - text.x1), gc.color,
&image((yi - y) - image.dim(0), text.x1 - x));
}
}
}
}
Expand Down

0 comments on commit ce5fb1f

Please sign in to comment.