diff --git a/src/app/GUI/graphboxeslist.cpp b/src/app/GUI/graphboxeslist.cpp index 1a9b9dda4..660725514 100644 --- a/src/app/GUI/graphboxeslist.cpp +++ b/src/app/GUI/graphboxeslist.cpp @@ -55,22 +55,19 @@ void KeysView::graphEasingAction(const QString &easing) if (mSelectedKeysAnimators.isEmpty()) { return; } if (mGraphViewed) { for (const auto& anim : mGraphAnimators) { - QList> segments; - anim->graph_getSelectedSegments(segments); - for (const auto& segment : segments) { - Q_ASSERT(segment.length() > 1); - auto firstKey = segment.first(); - auto lastKey = segment.last(); - graphEasingApply(static_cast(anim), - {firstKey->getRelFrame(), - lastKey->getRelFrame()}, - easing); - } + const auto segments = anim->anim_getSelectedKeys(); + if (segments.count() < 2) { continue; } + auto firstKey = segments.first(); + auto lastKey = segments.last(); + graphEasingApply(static_cast(anim), + {firstKey->getRelFrame(), + lastKey->getRelFrame()}, + easing); } } else { for (const auto& anim : mSelectedKeysAnimators) { const auto &segments = anim->anim_getSelectedKeys(); - Q_ASSERT(segments.length() > 1); + if (segments.count() < 2) { continue; } auto firstKey = segments.first(); auto lastKey = segments.last(); graphEasingApply(static_cast(anim),