aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/components/timelineeditor
diff options
context:
space:
mode:
authorMahmoud Badri <mahmoud.badri@qt.io>2019-10-07 10:43:39 +0300
committerMahmoud Badri <mahmoud.badri@qt.io>2019-10-07 12:19:34 +0000
commitef9085b310c987d62672a3c4681061093da2fe72 (patch)
tree5aa9e5d1897c991eefc0ea207dd3c92f56693d55 /src/plugins/qmldesigner/components/timelineeditor
parent425732f810da228a439952c03fdde22ee948c5cf (diff)
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 <miikka.heikkinen@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src/plugins/qmldesigner/components/timelineeditor')
-rw-r--r--src/plugins/qmldesigner/components/timelineeditor/timelineselectiontool.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelineselectiontool.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelineselectiontool.cpp
index 77f419fc39..a33f844b2e 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);