private void addArc(double x, double y, double width, double height, double start, double sweep) {
		double aspectRatio = height / width;
		double rx = width / 2.0;
		double ry = height / 2.0;
		double xc = x + rx;
		double yc = y + ry;
		if (sweep < 0) {
			start += sweep;
			sweep = -sweep;
		}
		if (sweep > 359.99) sweep = 360;
		double dt = Math.atan2(1, Math.max(width, height));
		int nSteps = (int) (GMath.toRadians(sweep) / dt);
		dt = GMath.toRadians(sweep) / nSteps;
		double theta = GMath.toRadians(start);
		for (int i = 0; i <= nSteps; i++) {
			double px = xc + rx * Math.cos(theta);
			double py = yc - rx * Math.sin(theta) * aspectRatio;
			poly.addPoint(GMath.round(px + EPSILON), GMath.round(py + EPSILON));
			theta += dt;
		}
	}