Bug 999 : empty shape or duplicate vertices with P2D causes NullPointerException
Last modified: 2008-11-06 14:01




Status:
RESOLVED
Resolution:
INVALID -
Priority:
P2
Severity:
normal

 

Reporter:
kmcdonald
Assigned To:
fry

Attachment Type Created Size Actions
Example code to demonstrate the bug. application/octet-stream 2008-11-05 00:15 88 bytes

Description:   Opened: 2008-11-05 00:12
First noticed in 148, still there in 155.

[code]
void setup() {
size(256, 256, P2D);
}

void draw() {
beginShape();
endShape();
}
[/code]

Or:

[code]
beginShape();
vertex(1, 1);
vertex(1, 1);
endShape();
[/code]

Yields:

[code]
Exception in thread "Animation Thread" java.lang.NullPointerException
at processing.core.PGraphics2D.resetMatrix(PGraphics2D.java:1849)
at processing.core.PGraphics2D.beginDraw(PGraphics2D.java:116)
at processing.core.PApplet.handleDraw(PApplet.java:1365)
at processing.core.PApplet.run(PApplet.java:1300)
at java.lang.Thread.run(Unknown Source)
[/code]
Additional Comment #1 From kmcdonald 2008-11-05 00:15
edit]
Example code to demonstrate the bug.
Additional Comment #2 From fry 2008-11-05 07:26
P2D does not exist yet. it will arrive soon, before the release of 1.0, but
it does not currently exist. see the reference for the size() command.
Additional Comment #3 From kmcdonald 2008-11-05 08:41
I started to realize this after trying to do other things.

I think I was just confused because it "partially" exists. Enough for it to
be the fastest thing that lets me flip pixels on a PImage and then draw the
PImage to the screen without distortion. P3D is fast too, but doesn't draw
the image pixel-for-pixel.
Additional Comment #4 From fry 2008-11-06 14:00
right, i just need to disable it more explicitly until i've finished...