From aec46f25cf3b35f46705a93b97ddbccc92235f03 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Wed, 30 Jul 2014 22:07:44 -0400 Subject: [PATCH] better fix for 2208 --- core/src/processing/core/PGraphicsJava2D.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/processing/core/PGraphicsJava2D.java b/core/src/processing/core/PGraphicsJava2D.java index a42f1ea3f..af906a6dd 100644 --- a/core/src/processing/core/PGraphicsJava2D.java +++ b/core/src/processing/core/PGraphicsJava2D.java @@ -1302,9 +1302,10 @@ public class PGraphicsJava2D extends PGraphics { if (who.modified) { if (who.pixels == null) { - // This might be a PGraphics that hasn't been drawn to yet, bail out. + // This might be a PGraphics that hasn't been drawn to yet. + // Can't just bail because the cache has been created above. // https://github.com/processing/processing/issues/2208 - return; + who.pixels = new int[who.width * who.height]; } cash.update(who, tint, tintColor); who.modified = false;