/** * Scrolls the content so that the given revision is visible. * * @param revision the revision to scroll the client area to. */ private void scrollToRevision(Revision revision) { Rectangle revBounds = revision.getBounds(); Rectangle clientArea = getClientArea(); clientArea.x = getOrigin().x; clientArea.y = getOrigin().y; if (!clientArea.contains(revBounds.x, revBounds.y) && !clientArea.contains(revBounds.x + revBounds.width, revBounds.y + revBounds.height)) { setOrigin(revBounds.x, revBounds.y); } }