Skip to content

Commit

Permalink
Graph: easing get selected fix #228
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Aug 25, 2024
1 parent 12cb8b5 commit 1848062
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/app/GUI/graphboxeslist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,19 @@ void KeysView::graphEasingAction(const QString &easing)
if (mSelectedKeysAnimators.isEmpty()) { return; }
if (mGraphViewed) {
for (const auto& anim : mGraphAnimators) {
QList<QList<GraphKey*>> 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<QrealAnimator*>(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<QrealAnimator*>(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<QrealAnimator*>(anim),
Expand Down

0 comments on commit 1848062

Please sign in to comment.