Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b99e636 commit 2a01039Copy full SHA for 2a01039
src/_backend_agg.cpp
@@ -201,10 +201,15 @@ agg::rect_i RendererAgg::get_content_extents()
201
}
202
203
204
- r.x1 = std::max(0, r.x1);
205
- r.y1 = std::max(0, r.y1);
206
- r.x2 = std::min(r.x2 + 1, (int)width);
207
- r.y2 = std::min(r.y2 + 1, (int)height);
+ if (r.x1 == width && r.x2 == 0) {
+ // The buffer is completely empty.
+ r.x1 = r.y1 = r.x2 = r.y2 = 0;
+ } else {
208
+ r.x1 = std::max(0, r.x1);
209
+ r.y1 = std::max(0, r.y1);
210
+ r.x2 = std::min(r.x2 + 1, (int)width);
211
+ r.y2 = std::min(r.y2 + 1, (int)height);
212
+ }
213
214
return r;
215
0 commit comments