Skip to content

Commit d86976e

Browse files
committed
Fix off-by-one error when blending onto itself
1 parent fe6047e commit d86976e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/processing/core/PImage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,8 +1862,8 @@ public void blend(PImage src,
18621862
loadPixels();
18631863
if (src == this) {
18641864
if (intersect(sx, sy, sx2, sy2, dx, dy, dx2, dy2)) {
1865-
blit_resize(get(sx, sy, sx2 - sx, sy2 - sy),
1866-
0, 0, sx2 - sx - 1, sy2 - sy - 1,
1865+
blit_resize(get(sx, sy, sw, sh),
1866+
0, 0, sw, sh,
18671867
pixels, pixelWidth, pixelHeight, dx, dy, dx2, dy2, mode);
18681868
} else {
18691869
// same as below, except skip the loadPixels() because it'd be redundant

0 commit comments

Comments
 (0)