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

Skip to content

Commit f0792ba

Browse files
committed
FIX: argument order in RendereAgg.restore_region
In ba40160 Remove use of PyCXX in core C++ extensions the order of the arguments into the `restore_region` that takes off sets was swapped. The order should be (x1, x2, y1, y2, offset_x, offset_y) which was the order of `restore_region2` (a function removed as part of the refactor in favor of simple dispatch in the wrapper code + c++ function overloading) and the order of the arguments passed out of the python layer, but at the c++ layer they were being mapped to (offset_x, offset_y, x1, x2, y1, y2) which was causing a region not of interest to be restored. closes #4947
1 parent 512b5d7 commit f0792ba

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/_backend_agg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void RendererAgg::restore_region(BufferRegion &region)
109109

110110
// Restore the part of the saved region with offsets
111111
void
112-
RendererAgg::restore_region(BufferRegion &region, int x, int y, int xx1, int yy1, int xx2, int yy2)
112+
RendererAgg::restore_region(BufferRegion &region, int xx1, int yy1, int xx2, int yy2, int x, int y )
113113
{
114114
if (region.get_data() == NULL) {
115115
throw "Cannot restore_region from NULL data";

src/_backend_agg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ class RendererAgg
215215

216216
BufferRegion *copy_from_bbox(agg::rect_d in_rect);
217217
void restore_region(BufferRegion &reg);
218-
void restore_region(BufferRegion &region, int x, int y, int xx1, int yy1, int xx2, int yy2);
218+
void restore_region(BufferRegion &region, int xx1, int yy1, int xx2, int yy2, int x, int y);
219219

220220
unsigned int width, height;
221221
double dpi;

0 commit comments

Comments
 (0)