From e86262f30c90676be59079bce706267d2f4446e9 Mon Sep 17 00:00:00 2001 From: benfry Date: Fri, 14 Mar 2008 02:11:58 +0000 Subject: [PATCH] fix for mask() and updatePixels (bug #744) --- core/src/processing/core/PImage.java | 7 +++++++ core/todo.txt | 2 ++ 2 files changed, 9 insertions(+) diff --git a/core/src/processing/core/PImage.java b/core/src/processing/core/PImage.java index 3fc5edf8f..01f2bd8fb 100644 --- a/core/src/processing/core/PImage.java +++ b/core/src/processing/core/PImage.java @@ -379,6 +379,7 @@ public class PImage implements PConstants, Cloneable { public void set(int x, int y, int c) { if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) return; pixels[y*width + x] = c; + updatePixels(x, y, x+1, y+1); // slow? } @@ -426,6 +427,11 @@ public class PImage implements PConstants, Cloneable { srcOffset += src.width; dstOffset += width; } + if (imageMode == CORNER) { + updatePixels(sx, sy, sw, sh); + } else { + updatePixels(sx, sy, sx+sw, sy+sh); + } } @@ -458,6 +464,7 @@ public class PImage implements PConstants, Cloneable { pixels[i] = ((alpha[i] & 0xff) << 24) | (pixels[i] & 0xffffff); } format = ARGB; + updatePixels(); } diff --git a/core/todo.txt b/core/todo.txt index 5d54b1e8c..ec06c2daa 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -20,6 +20,8 @@ X fix bug with splice() and arrays X http://dev.processing.org/bugs/show_bug.cgi?id=734 X 'screen' is now static _ undo this--may need to be better about specifying screen and all +X PImage mask doesn't work after first call +X http://dev.processing.org/bugs/show_bug.cgi?id=744 _ change openStream() to createInput() _ add createOutput() (and raw versions of the same, err.. no raw)