From e23be1da5b6b052bbdf8db49fbe68444cc2179b0 Mon Sep 17 00:00:00 2001 From: benfry Date: Wed, 7 Jan 2009 21:36:49 +0000 Subject: [PATCH] fix requestionImage() problem with Java2D --- core/src/processing/core/PGraphicsJava2D.java | 3 +++ core/todo.txt | 2 ++ 2 files changed, 5 insertions(+) diff --git a/core/src/processing/core/PGraphicsJava2D.java b/core/src/processing/core/PGraphicsJava2D.java index 6b6c5698a..ae17f6222 100644 --- a/core/src/processing/core/PGraphicsJava2D.java +++ b/core/src/processing/core/PGraphicsJava2D.java @@ -786,6 +786,9 @@ public class PGraphicsJava2D extends PGraphics /*PGraphics2D*/ { protected void imageImpl(PImage who, float x1, float y1, float x2, float y2, int u1, int v1, int u2, int v2) { + // Image not ready yet, or an error + if (who.width <= 0 || who.height <= 0) return; + if (who.getCache(this) == null) { //System.out.println("making new image cache"); who.setCache(this, new ImageCache(who)); diff --git a/core/todo.txt b/core/todo.txt index 4dfc869aa..c261eaabb 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -1,4 +1,6 @@ 0164 core +X requestImage() causing problems with JAVA2D + P1 _ OutOfMemoryError with ellipse() in P3D and OPENGL P1 _ http://dev.processing.org/bugs/show_bug.cgi?id=1086 P4 _ point(x,y) ignores noStroke() (in some renderers)