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

Skip to content

Commit af42e6b

Browse files
committed
fixed image wrap on resize
svn path=/trunk/matplotlib/; revision=361
1 parent b569e63 commit af42e6b

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/_backend_agg.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -895,8 +895,11 @@ RendererAgg::draw_image(const Py::Tuple& args) {
895895
thisx = i+x;
896896
thisy = isUpper ? oy+j : oy-j;
897897

898-
if (thisx<0 || thisx>=width) continue;
899-
if (thisy<0 || thisy>=height) continue;
898+
if (thisx<0 || thisx>=width || thisy<0 || thisy>=height) {
899+
ind += 4;
900+
continue;
901+
}
902+
900903
pixfmt::color_type p;
901904
p.r = *(image->bufferOut+ind++);
902905
p.g = *(image->bufferOut+ind++);

src/_image.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,10 @@ _image_module::from_images(const Py::Tuple& args) {
477477
for (size_t i=0; i<thisim->colsOut; i++) {
478478
thisx = i+ox;
479479
thisy = j+oy;
480-
if (thisx<0 || thisx>=numcols) continue;
481-
if (thisy<0 || thisy>=numrows) continue;
480+
if (thisx<0 || thisx>=numcols || thisy<0 || thisy>=numrows) {
481+
ind +=4;
482+
continue;
483+
}
482484

483485
pixfmt::color_type p;
484486
p.r = *(thisim->bufferOut+ind++);

0 commit comments

Comments
 (0)