summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2019-08-15 11:48:19 +0300
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2019-08-15 13:28:28 +0300
commit5a38591d0c30d5e639f9cc466b0ff8246376cfff (patch)
tree5126614d771daab1ca8f1ee5ec259068f69c74a0
parentbe25513362a662b08599f792c35e143ab2a8314d (diff)
Snap playhead to all keyframes
Keyframes on rows that didn't have duration bars (materials) weren't included in snap list. Task-number: QT3DS-3872 Change-Id: If0205282ee759dd69f82a84fccf1c5b1b1d4309b Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r--src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp b/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp
index 4b5cd055..0ae0cfcc 100644
--- a/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp
+++ b/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp
@@ -725,14 +725,16 @@ void TimelineGraphicsScene::updateSnapSteps()
// i = 1 is always the scene row (or component root)
for (int i = 2; i < m_layoutTimeline->count(); i++) {
RowTree *rowTree = static_cast<RowTree *>(m_layoutTree->itemAt(i)->graphicsItem());
- if (rowTree->hasDurationBar() && rowTree->isVisible()) {
- double startX = rowTree->rowTimeline()->getStartX();
- if (!m_snapSteps.contains(startX))
- m_snapSteps.push_back(startX);
-
- double endX = rowTree->rowTimeline()->getEndX();
- if (!m_snapSteps.contains(endX))
- m_snapSteps.push_back(endX);
+ if (rowTree->isVisible()) {
+ if (rowTree->hasDurationBar()) {
+ double startX = rowTree->rowTimeline()->getStartX();
+ if (!m_snapSteps.contains(startX))
+ m_snapSteps.push_back(startX);
+
+ double endX = rowTree->rowTimeline()->getEndX();
+ if (!m_snapSteps.contains(endX))
+ m_snapSteps.push_back(endX);
+ }
// add keyframes times
if (rowTree->hasPropertyChildren()) {