added MAX_POINT_ACCURACY constant to cap number of segments used when

drawing an ellipse
This commit is contained in:
codeanticode
2013-08-20 18:41:35 -04:00
parent 91dd20162a
commit 28e2501a11
2 changed files with 12 additions and 9 deletions

View File

@@ -4552,9 +4552,10 @@ public class PShapeOpenGL extends PShape {
int perim;
if (0 < size) { // round point
weight = +size / 0.5f;
perim = PApplet.max(PGraphicsOpenGL.MIN_POINT_ACCURACY,
perim = PApplet.min(PGraphicsOpenGL.MAX_POINT_ACCURACY,
PApplet.max(PGraphicsOpenGL.MIN_POINT_ACCURACY,
(int) (TWO_PI * weight /
PGraphicsOpenGL.POINT_ACCURACY_FACTOR)) + 1;
PGraphicsOpenGL.POINT_ACCURACY_FACTOR))) + 1;
} else { // Square point
weight = -size / 0.5f;
perim = 5;