diff --git a/src/plugins/qmldesigner/designercore/model/qmltimelinekeyframegroup.cpp b/src/plugins/qmldesigner/designercore/model/qmltimelinekeyframegroup.cpp index 35ff98710ca..8a6defa4694 100644 --- a/src/plugins/qmldesigner/designercore/model/qmltimelinekeyframegroup.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmltimelinekeyframegroup.cpp @@ -34,6 +34,7 @@ #include +#include #include namespace QmlDesigner { @@ -282,7 +283,7 @@ void QmlTimelineKeyframeGroup::moveAllKeyframes(qreal offset) for (const ModelNode &childNode : modelNode().defaultNodeListProperty().toModelNodeList()) { auto property = childNode.variantProperty("frame"); if (property.isValid()) - property.setValue(property.value().toReal() + offset); + property.setValue(std::round(property.value().toReal() + offset)); } } @@ -292,7 +293,7 @@ void QmlTimelineKeyframeGroup::scaleAllKeyframes(qreal factor) auto property = childNode.variantProperty("frame"); if (property.isValid()) - property.setValue(property.value().toReal() * factor); + property.setValue(std::round(property.value().toReal() * factor)); } }