aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp')
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp
index 86aae0b2cc..90818be74b 100644
--- a/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp
+++ b/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp
@@ -87,6 +87,16 @@ QRectF CurveItem::boundingRect() const
for (auto *item : m_keyframes)
bbox(bounds, item->keyframe());
+ if (auto *s = qobject_cast<GraphicsScene *>(scene())) {
+ bounds.setLeft(s->animationRangeMin());
+ bounds.setRight(s->animationRangeMax());
+ }
+
+ if (qFuzzyCompare(bounds.height(), 0.0)) {
+ auto tmp = CurveEditorStyle::defaultValueRange() / 2.0;
+ bounds.adjust(0.0, -tmp, 0.0, tmp);
+ }
+
return m_transform.mapRect(bounds);
}