private void arc(float x, float y, float radius, float start, float degrees, ShapeRenderer.ShapeType shapeType) { arc(x, y, radius, start, degrees, Math.max(1, (int) (6 * (float) Math.cbrt(radius) * (degrees / 360.0f))), shapeType); }
@Override public void drawArc(int x, int y, int w, int h, int startAngle, int arcAngle) { int radius = w / 2 + 1; int cx = x + radius; int cy = height - y - h / 2 - 1; endBatch(); shapeRenderer.begin(ShapeRenderer.ShapeType.Line); shapeRenderer.setColor(currentColor); arc(cx, cy, radius, startAngle, arcAngle, ShapeRenderer.ShapeType.Line); shapeRenderer.end(); }
@Override public void fillArc(int x, int y, int w, int h, int startAngle, int arcAngle) { int radius = w / 2 + 1; int cx = x + radius; int cy = height - y - h / 2 - 1; endBatch(); shapeRenderer.begin(ShapeRenderer.ShapeType.Filled); shapeRenderer.setColor(currentColor); arc(cx, cy, radius, startAngle, arcAngle, ShapeRenderer.ShapeType.Filled); shapeRenderer.end(); }