[escher/scroll_view] Do not compute offset if view invisible

This commit is contained in:
Léa Saviot
2020-05-14 17:15:39 +02:00
committed by Émilie Feral
parent 3e4478454c
commit 9d5e58f32b

View File

@@ -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();
}