private void validateCache() {
		GRectangle bounds = null;
		double start = 0;
		double sweep = 360;
		if (target instanceof GOval || target instanceof GRoundRect) {
			bounds = target.getBounds();
		} else {
			GArc arc = (GArc) target;
			bounds = arc.getFrameRectangle();
			start = arc.getStartAngle();
			sweep = arc.getSweepAngle();
			if (start != oldStart || sweep != oldSweep) cacheValid = false;
		}
		if (bounds == null) return;
		double x = bounds.getX();
		double y = bounds.getY();
		double width = bounds.getWidth();
		double height = bounds.getHeight();
		if (width <= 0 || height <= 0) return;
		if (!cacheValid || width != oldBounds.getWidth() || height != oldBounds.getHeight()) {
			poly.npoints = 0;
			if (target instanceof GRoundRect) {
				GRoundRect rr = (GRoundRect) target;
				double arcWidth = GMath.round(rr.getArcWidth());
				double arcHeight = GMath.round(rr.getArcHeight());
				poly.addPoint(GMath.round(x + arcWidth / 2 + EPSILON), GMath.round(y + EPSILON));
				addArc(x, y, arcWidth, arcHeight, 90, 90);
				addArc(x, y + height - arcHeight, arcWidth, arcHeight, 180, 90);
				addArc(x + width - arcWidth, y + height - arcHeight, arcWidth, arcHeight, 270, 90);
				addArc(x + width - arcWidth, y, arcWidth, arcHeight, 0, 90);
			} else {
				addArc(x, y, width, height, start, sweep);
				if (target instanceof GArc) {
					poly.addPoint(GMath.round(x + width / 2 + EPSILON), GMath.round(y + height / 2 + EPSILON));
					oldStart = start;
					oldSweep = sweep;
				}
			}
			x0 = GMath.round(poly.xpoints[0] - x);
			y0 = GMath.round(poly.ypoints[0] - y);
			oldBounds = bounds;
		}
		if (x != oldBounds.getX() || y != oldBounds.getY()) {
			movePoly(GMath.round(x + EPSILON), GMath.round(y + EPSILON));
			oldBounds = bounds;
		}
		cacheValid = true;
	}