aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp')
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp
index bfa836137f..94b53a3ea5 100644
--- a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp
+++ b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp
@@ -378,13 +378,16 @@ void GraphicsView::applyZoom(double x, double y, const QPoint &pivot)
double minTime = minimumTime();
double maxTime = maximumTime();
+ double minValue = minimumValue();
+ double maxValue = maximumValue();
+
QRectF canvas = canvasRect();
double xZoomedOut = canvas.width() / (maxTime - minTime);
double xZoomedIn = m_style.zoomInWidth;
double scaleX = lerp(clamp(m_zoomX, 0.0, 1.0), xZoomedOut, xZoomedIn);
- double yZoomedOut = canvas.height() / maximumValue();
+ double yZoomedOut = canvas.height() / (maxValue - minValue);
double yZoomedIn = m_style.zoomInHeight;
double scaleY = lerp(clamp(m_zoomY, 0.0, 1.0), -yZoomedOut, -yZoomedIn);
@@ -480,8 +483,6 @@ void GraphicsView::drawExtremaY(QPainter *painter, const QRectF &rect)
drawHorizontalLine(mapValueToY(m_scene.minimumValue()));
drawHorizontalLine(mapValueToY(m_scene.maximumValue()));
- drawHorizontalLine(mapValueToY(0.0));
-
painter->restore();
}