public void clipSourceDest(CPRect srcRect, CPRect dstRect) {
		dstRect.right = dstRect.left + srcRect.getWidth();
		dstRect.bottom = dstRect.top + srcRect.getHeight();

		if (isEmpty() || dstRect.left >= right || dstRect.top >= bottom || dstRect.right <= left
				|| dstRect.bottom <= top) {
			srcRect.makeEmpty();
			dstRect.makeEmpty();
			return;
		}

		// bottom/right
		if (dstRect.right > right) {
			srcRect.right -= dstRect.right - right;
			dstRect.right = right;
		}

		if (dstRect.bottom > bottom) {
			srcRect.bottom -= dstRect.bottom - bottom;
			dstRect.bottom = bottom;
		}

		// top/left
		if (dstRect.left < left) {
			srcRect.left += left - dstRect.left;
			dstRect.left = left;
		}

		if (dstRect.top < top) {
			srcRect.top += top - dstRect.top;
			dstRect.top = top;
		}
	}