From f0792ba02fda46be647e76172a012f47ce349e1a Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Mon, 17 Aug 2015 23:22:30 -0400 Subject: [PATCH] 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 --- src/_backend_agg.cpp | 2 +- src/_backend_agg.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_backend_agg.cpp b/src/_backend_agg.cpp index fba3ef71d77d..9e9ae5ce9f3f 100644 --- a/src/_backend_agg.cpp +++ b/src/_backend_agg.cpp @@ -109,7 +109,7 @@ void RendererAgg::restore_region(BufferRegion ®ion) // Restore the part of the saved region with offsets void -RendererAgg::restore_region(BufferRegion ®ion, int x, int y, int xx1, int yy1, int xx2, int yy2) +RendererAgg::restore_region(BufferRegion ®ion, int xx1, int yy1, int xx2, int yy2, int x, int y ) { if (region.get_data() == NULL) { throw "Cannot restore_region from NULL data"; diff --git a/src/_backend_agg.h b/src/_backend_agg.h index 26f989e9d85c..ef59d8fde82e 100644 --- a/src/_backend_agg.h +++ b/src/_backend_agg.h @@ -215,7 +215,7 @@ class RendererAgg BufferRegion *copy_from_bbox(agg::rect_d in_rect); void restore_region(BufferRegion ®); - void restore_region(BufferRegion ®ion, int x, int y, int xx1, int yy1, int xx2, int yy2); + void restore_region(BufferRegion ®ion, int xx1, int yy1, int xx2, int yy2, int x, int y); unsigned int width, height; double dpi;