Skip to content

Commit 9b59618

Browse files
committed
add special case for image() with degenerate PGraphics (fixes processing#2208)
1 parent 2ae4c6e commit 9b59618

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

core/src/processing/core/PGraphicsJava2D.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,6 +1301,11 @@ protected void imageImpl(PImage who,
13011301
}
13021302

13031303
if (who.modified) {
1304+
if (who.pixels == null) {
1305+
// This might be a PGraphics that hasn't been drawn to yet, bail out.
1306+
// https://github.com/processing/processing/issues/2208
1307+
return;
1308+
}
13041309
cash.update(who, tint, tintColor);
13051310
who.modified = false;
13061311
}

core/todo.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ X move to native OS X full screen (gets rid of native code)
66
X https://github.com/processing/processing/issues/2641
77
X do bounds check on setVertex(PVector)
88
X https://github.com/processing/processing/issues/2556
9+
X using createGraphics() w/o begin/endDraw(), don't attempt drawing w/ image()
10+
X https://github.com/processing/processing/issues/2208
911

1012
data
1113
X add copy() method to Table

todo.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ X https://github.com/processing/processing/issues/2656
3333
X add a new pref for the 3.0 sketchbook location
3434
X if Server constructor fails, throw an exception
3535
X https://github.com/processing/processing/issues/2604
36+
o check on why 2x core.jar inside the Java folder
37+
o maybe OS X Java can't look in subfolders? (just auto-adds things)
38+
o https://github.com/processing/processing/issues/2344
39+
X one is used by the PDE, the other is used as a library
40+
_ changing the mode on an untitled, unmodified sketch removes untitled status
3641
_ when renaming a tab, include the previous name to be edited
3742

3843
gsoc
@@ -109,8 +114,6 @@ _ http://www.java2s.com/Code/Java/Network-Protocol/DetectProxySettingsforInter
109114

110115
medium
111116
_ possibility of libraries folder inside a particular sketch?
112-
_ check on why 2x core.jar inside the Java folder
113-
_ maybe OS X Java can't look in subfolders? (just auto-adds things)
114117
_ display "1" is not correct in 2.1.2
115118
_ https://github.com/processing/processing/issues/2502
116119
_ re/move things from Google Code downloads

0 commit comments

Comments
 (0)