diff options
Diffstat (limited to 'src/Authoring')
3 files changed, 6 insertions, 18 deletions
diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/KeyframeManager.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/KeyframeManager.cpp index e234e99e..570c3981 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/KeyframeManager.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/KeyframeManager.cpp @@ -173,11 +173,10 @@ void KeyframeManager::selectKeyframesInRect(const QRectF &rect) m_scene->rowManager()->clampIndex(idx1); m_scene->rowManager()->clampIndex(idx2); - RowTimeline *rowTimeline; for (int i = idx1; i <= idx2; ++i) { - rowTimeline = m_scene->rowManager()->rowTimelineAt(i); + RowTimeline *rowTimeline = m_scene->rowManager()->rowTimelineAt(i); - if (rowTimeline != nullptr) { + if (rowTimeline) { const auto keyframes = rowTimeline->getKeyframesInRange(rect.left(), rect.right()); for (auto keyframe : keyframes) { if (!m_selectedKeyframes.contains(keyframe)) { @@ -402,7 +401,7 @@ bool KeyframeManager::hasSelectedKeyframes() const bool KeyframeManager::hasCopiedKeyframes() const { - return m_pasteKeyframeCommandHelper != nullptr && + return m_pasteKeyframeCommandHelper && m_pasteKeyframeCommandHelper->HasCopiedKeyframes(); } diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTimeline.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTimeline.cpp index 0c58f7dd..e768283d 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTimeline.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTimeline.cpp @@ -285,26 +285,15 @@ Keyframe *RowTimeline::getClickedKeyframe(const QPointF &scenePos) return nullptr; } -QList<Keyframe *> RowTimeline::getKeyframesInRange(const double left, const double right) +QList<Keyframe *> RowTimeline::getKeyframesInRange(double left, double right) { double x; double x1 = mapFromScene(left, 0).x(); double x2 = mapFromScene(right, 0).x(); QList<Keyframe *> result; - QList<Keyframe *> keyframes; - if (m_rowTree->hasPropertyChildren()) { - const auto childRows = m_rowTree->childRows(); - for (auto child : childRows) { - if (child->isProperty()) - keyframes.append(child->rowTimeline()->m_keyframes); - } - } else { - keyframes = m_keyframes; - } - - for (auto keyframe : qAsConst(keyframes)) { + for (auto keyframe : qAsConst(m_keyframes)) { x = timeToX(keyframe->time); if (x1 < x && x2 > x) diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTimeline.h b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTimeline.h index 3c12a26a..831c02e0 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTimeline.h +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTimeline.h @@ -76,7 +76,7 @@ public: RowTimeline *parentRow() const; RowTree *rowTree() const; Keyframe *getClickedKeyframe(const QPointF &scenePos); - QList<Keyframe *> getKeyframesInRange(const double left, const double right); + QList<Keyframe *> getKeyframesInRange(double left, double right); QList<Keyframe *> keyframes() const; void showToolTip(const QPointF &pos); |