void setRectClip(Rectangle clip) {
		if (clip == null) {
			rectClip.x = rectClip.y = 0;
			rectClip.setSize(dimScreen);
		}
		else {
			rectClip.setBounds(clip);
			// on Linux platform with Sun 1.4.2_02 I am getting a clipping rectangle
			// that is wider than the current window during window resize
			if (rectClip.x < 0)
				rectClip.x = 0;
			if (rectClip.y < 0)
				rectClip.y = 0;
			if (rectClip.x + rectClip.width > dimScreen.width)
				rectClip.width = dimScreen.width - rectClip.x;
			if (rectClip.y + rectClip.height > dimScreen.height)
				rectClip.height = dimScreen.height - rectClip.y;
		}
	}