Bug 1095 : inconsistencies with arc() angles
Last modified: 2009-02-20 18:06




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

 

Reporter:
ames
Assigned To:
fry

Attachment Type Created Size Actions
unified patch file for processing/core/src/processing/core/PGraphics2D.java patch 2008-12-13 03:10 590 bytes
unified patch file for processing/core/src/processing/core/PGraphics3D.java patch 2008-12-13 03:11 594 bytes

Description:   Opened: 2008-12-05 17:00
When using OPENGL, and arc() with negative Start angle and a larger (less
negative, but still negative) End angle, I get an
ArrayIndexOutOfBoundsException.


import processing.opengl.*;
size(100,100,OPENGL);
arc(50,50,50,50,-PI,-HALF_PI);


will cause an error:

Exception in thread "Animation Thread"
java.lang.ArrayIndexOutOfBoundsException: -179
at processing.core.PGraphics3D.arcImpl(PGraphics3D.java:2679)
at processing.core.PGraphics.arc(PGraphics.java:1560)
at processing.core.PApplet.arc(PApplet.java:6972)
at mySketch.setup(mySketch.java:20)
at processing.core.PApplet.handleDraw(PApplet.java:1383)
at processing.core.PApplet.run(PApplet.java:1311)
at java.lang.Thread.run(Thread.java:613)

I'm running Mac OS 10.5 and Processing 1.0.1 (discovered a few versions ago)
Additional Comment #1 From dlp 2008-12-13 03:10
edit]
unified patch file for processing/core/src/processing/core/PGraphics2D.java
Additional Comment #2 From dlp 2008-12-13 03:11
edit]
unified patch file for processing/core/src/processing/core/PGraphics3D.java
Additional Comment #3 From dlp 2008-12-13 03:14
This is not unique to the OpenGL renderer–both the P2D and P3D renderers
will also exhibit this behavior. This is because neither the 2D or the 3D
renderers check for negative angles sent to arc().

It's a really easy fix–I just copied over the code from the Java2D
renderer, and adjusted it to use radians.
Additional Comment #4 From fry 2009-02-20 18:06
Fixed for 1.0.2. This recovered a couple other obscure (but easily
remedied) problems that have also been fixed.

Thanks for the report and example, very helpful.