summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <jb@kdenlive.org>2016-11-02 21:24:15 (GMT)
committerJean-Baptiste Mardelle <jb@kdenlive.org>2016-11-02 21:24:15 (GMT)
commita6d10adf0c8df453cfbb765da4437132986a1b9d (patch)
treeba9d821fa2e077b41604e9b4d311451665720483
parent1d1595e7d14ef6b0560dc93940f9c23ed96a4ce7 (diff)
Fix unwanted vertical scrolling
BUG: 371982
-rw-r--r--src/timeline/customtrackview.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/timeline/customtrackview.cpp b/src/timeline/customtrackview.cpp
index 2f45ce9..0e9bdc6 100644
--- a/src/timeline/customtrackview.cpp
+++ b/src/timeline/customtrackview.cpp
@@ -4037,10 +4037,14 @@ void CustomTrackView::initCursorPos(int pos)
void CustomTrackView::checkScrolling()
{
- QGraphicsView::ViewportUpdateMode mode = viewportUpdateMode();
- setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
- ensureVisible(seekPosition(), verticalScrollBar()->value() + 10, 2, 2, 50, 0);
- setViewportUpdateMode(mode);
+ double xPos = seekPosition();
+ QRectF viewRect = mapToScene(rect()).boundingRect();
+ if (xPos - viewRect.left() < 50 || viewRect.right() - xPos < 50) {
+ QGraphicsView::ViewportUpdateMode mode = viewportUpdateMode();
+ setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
+ ensureVisible(xPos, viewRect.top() + 5, 2, 2, 50, 0);
+ setViewportUpdateMode(mode);
+ }
}
void CustomTrackView::scrollToStart()