From ef9085b310c987d62672a3c4681061093da2fe72 Mon Sep 17 00:00:00 2001 From: Mahmoud Badri Date: Mon, 7 Oct 2019 10:43:39 +0300 Subject: [PATCH] Correct timeline selection rect. vertical bounds When the timeline graphics view has no vertical scolling, the vertical scroll bar value is 0. The patch makes sure the min value is at least the ruler height. Change-Id: Ibc49dacbe8d5c90c50c929ede03b1e89b18386cf Reviewed-by: Miikka Heikkinen Reviewed-by: Thomas Hartmann --- .../components/timelineeditor/timelineselectiontool.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelineselectiontool.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelineselectiontool.cpp index 77f419fc393..a33f844b2e1 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelineselectiontool.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelineselectiontool.cpp @@ -88,7 +88,8 @@ void TimelineSelectionTool::mouseMoveEvent(TimelineMovableAbstractItem *item, const qreal xMin = TimelineConstants::sectionWidth; const qreal xMax = scene()->graphicsView()->width() - TimelineConstants::timelineLeftOffset - 1; - const qreal yMin = scene()->graphicsView()->verticalScrollBar()->value(); + const qreal yMin = qMax(TimelineConstants::rulerHeight, + scene()->graphicsView()->verticalScrollBar()->value()); const qreal yMax = yMin + scene()->graphicsView()->height() - 1; endPoint.rx() = qBound(xMin, endPoint.x(), xMax);