if (point.x < leftMargin) {  point.x = Math.max(-horizontalScrollOffset, point.x - horizontalIncrement); scrolled = scrollHorizontal(point.x, true); } else if (point.x >= clientAreaWidth) {  point.x = Math.min(renderer.getWidth() - horizontalScrollOffset, point.x + horizontalIncrement); scrolled = scrollHorizontal(point.x - clientAreaWidth, true);
if (clientAreaWidth != 0) { if (point.x < leftMargin) {  point.x = Math.max(-horizontalScrollOffset, point.x - horizontalIncrement); scrolled = scrollHorizontal(point.x, true); } else if (point.x >= clientAreaWidth) {  point.x = Math.min(renderer.getWidth() - horizontalScrollOffset, point.x + horizontalIncrement); scrolled = scrollHorizontal(point.x - clientAreaWidth, true); }
boolean showLocation(Point point) {	Rectangle clientArea = getClientArea(); 	int clientAreaWidth = clientArea.width - leftMargin;	int horizontalIncrement = clientAreaWidth / 4;	boolean scrolled = false;	if (point.x < leftMargin) {		// always make 1/4 of a page visible		point.x = Math.max(-horizontalScrollOffset, point.x - horizontalIncrement);			scrolled = scrollHorizontal(point.x, true);	} else if (point.x >= clientAreaWidth) {		// always make 1/4 of a page visible		point.x = Math.min(renderer.getWidth() - horizontalScrollOffset, point.x + horizontalIncrement);		scrolled = scrollHorizontal(point.x - clientAreaWidth, true);	}	if (point.y < topMargin) {		scrolled = scrollVertical(point.y - topMargin, true);	} else if (point.y >= clientArea.height - bottomMargin) {		scrolled = scrollVertical(point.y - clientArea.height + bottomMargin, true);	}	return scrolled;}