From c6ab1d8b4f43ff3d458667273955e7194ba718b5 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Fri, 6 Dec 2019 11:55:20 +0100 Subject: [PATCH] QmlDesigner: fix endless loop when maxTime is 0 If there is no active timeline or maxtime is really 0 int GraphicsView::mapValueToY(double y) const was in an endless loop Change-Id: I42c18d9183338d2b76f1f06bab279da7f95b51d9 Reviewed-by: Thomas Hartmann Reviewed-by: Knud Dollereder --- .../qmldesigner/components/curveeditor/detail/graphicsview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp index b0f0c7637fa..2f943bf4957 100644 --- a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp @@ -554,7 +554,7 @@ double GraphicsView::timeLabelInterval(QPainter *painter, double maxTime) double tickDistance = mapTimeToX(deltaTime); while (true) { - if (tickDistance == 0 && deltaTime > maxTime) + if (tickDistance == 0 && deltaTime >= maxTime) return maxTime; if (tickDistance > minTextSpacing)