PImage.copy problem (bug #1174)

This commit is contained in:
benfry
2010-03-28 18:15:47 +00:00
parent b1bf338435
commit a7a488b9d6
3 changed files with 6 additions and 6 deletions

View File

@@ -1486,8 +1486,8 @@ public class PImage implements PConstants, Cloneable {
int mode) {
if (srcX1 < 0) srcX1 = 0;
if (srcY1 < 0) srcY1 = 0;
if (srcX2 >= img.width) srcX2 = img.width - 1;
if (srcY2 >= img.height) srcY2 = img.height - 1;
if (srcX2 > img.width) srcX2 = img.width;
if (srcY2 > img.height) srcY2 = img.height;
int srcW = srcX2 - srcX1;
int srcH = srcY2 - srcY1;