From 7a39a3c9df9987b66fb6cf2720c23538ee3a471f Mon Sep 17 00:00:00 2001 From: Knud Dollereder Date: Wed, 14 Aug 2019 13:11:38 +0200 Subject: [PATCH] Include handles when computing the scene extend Change-Id: I6a6cd17d97c7d590b329315283acdb90ab9117f1 Reviewed-by: Thomas Hartmann --- .../components/curveeditor/animationcurve.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/plugins/qmldesigner/components/curveeditor/animationcurve.cpp b/src/plugins/qmldesigner/components/curveeditor/animationcurve.cpp index f329ac6bae4..2c716652fdf 100644 --- a/src/plugins/qmldesigner/components/curveeditor/animationcurve.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/animationcurve.cpp @@ -327,6 +327,22 @@ void AnimationCurve::analyze() if (frame.position().y() > m_maxY) m_maxY = frame.position().y(); + + if (frame.hasLeftHandle()) { + if (frame.leftHandle().y() < m_minY) + m_minY = frame.leftHandle().y(); + + if (frame.leftHandle().y() > m_maxY) + m_maxY = frame.leftHandle().y(); + } + + if (frame.hasRightHandle()) { + if (frame.rightHandle().y() < m_minY) + m_minY = frame.rightHandle().y(); + + if (frame.rightHandle().y() > m_maxY) + m_maxY = frame.rightHandle().y(); + } } } }