public static Rectangle intersection(Rectangle first, Rectangle second) {
		if (first.width < 1 || first.height < 1 || second.width < 1 || second.height < 1) {
			return new Rectangle();
		}
		int x = Math.max(first.x, second.x);
		int y = Math.max(first.y, second.y);
		int w = Math.min(first.x + first.width, second.x + second.width) - x;
		int h = Math.min(first.y + first.height, second.y + second.height) - y;
		if (w < 0 || h < 0) {
			return new Rectangle();
		}
		return new Rectangle(x, y, w, h);
	}