diff --git a/escher/src/scroll_view.cpp b/escher/src/scroll_view.cpp index 294ec5350..ec06497d9 100644 --- a/escher/src/scroll_view.cpp +++ b/escher/src/scroll_view.cpp @@ -53,9 +53,16 @@ void ScrollView::scrollToContentPoint(KDPoint p, bool allowOverscroll) { if (!allowOverscroll && !m_contentView->bounds().contains(p)) { return; } + + KDRect visibleRect = visibleContentRect(); + + if (visibleRect.width() < 0 || visibleRect.height() < 0) { + return; + } + KDCoordinate offsetX = 0; KDCoordinate offsetY = 0; - KDRect visibleRect = visibleContentRect(); + if (visibleRect.left() > p.x()) { offsetX = p.x() - visibleRect.left(); }