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 <thomas.hartmann@qt.io>
Reviewed-by: Knud Dollereder <knud.dollereder@qt.io>
This commit is contained in:
Tim Jenssen
2019-12-06 11:55:20 +01:00
committed by Knud Dollereder
parent 8ebcef7b51
commit c6ab1d8b4f

View File

@@ -554,7 +554,7 @@ double GraphicsView::timeLabelInterval(QPainter *painter, double maxTime)
double tickDistance = mapTimeToX(deltaTime); double tickDistance = mapTimeToX(deltaTime);
while (true) { while (true) {
if (tickDistance == 0 && deltaTime > maxTime) if (tickDistance == 0 && deltaTime >= maxTime)
return maxTime; return maxTime;
if (tickDistance > minTextSpacing) if (tickDistance > minTextSpacing)