diff options
author | Mahmoud Badri <mahmoud.badri@qt.io> | 2019-08-30 10:38:06 +0300 |
---|---|---|
committer | Mahmoud Badri <mahmoud.badri@qt.io> | 2019-09-02 10:45:49 +0300 |
commit | 747f520cc2e16a97d38c3caf28ecb1880ae1aa4c (patch) | |
tree | 67ef832b1557e1999fc2e79590bf8ab0189c1d0c /src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/RowManager.cpp | |
parent | cd88fefac16b842d938f154d574330fcc0ed2432 (diff) |
Timeline ruler and scaling enhancements
- Make timeline scaling smoother and allow further scale values.
- Implement non linear scaling strategy which improve UX.
- Double clicking the scale head resets the scale to the default value
- Optimize drawing by only drawing the visible part of the ruler.
- Other assorted small tweaks
Change-Id: I5fbf729f3b5e098a60e26978af6bc82bb5f307ae
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/RowManager.cpp')
-rw-r--r-- | src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/RowManager.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/RowManager.cpp b/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/RowManager.cpp index b250062c..70a18560 100644 --- a/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/RowManager.cpp +++ b/src/Authoring/Qt3DStudio/Palettes/TimelineGraphicsView/RowManager.cpp @@ -292,15 +292,13 @@ void RowManager::updateRulerDuration(bool updateMaxDuration) long maxDuration = 0; // for setting correct size for the view so scrollbars appear correctly if (m_layoutTree->count() > 1) { auto rootRow = static_cast<RowTree *>(m_layoutTree->itemAt(1)->graphicsItem()); - bool isComponent = rootRow->objectType() == OBJTYPE_COMPONENT; - for (int i = 1; i < m_layoutTree->count(); ++i) { + bool insideComponent = rootRow->objectType() == OBJTYPE_COMPONENT; + for (int i = 2; i < m_layoutTree->count(); ++i) { RowTree *row_i = static_cast<RowTree *>(m_layoutTree->itemAt(i)->graphicsItem()); long dur_i = row_i->rowTimeline()->getEndTime(); - if (((isComponent && i != 1) || row_i->objectType() == OBJTYPE_LAYER) - && dur_i > duration) { + if ((insideComponent || row_i->objectType() == OBJTYPE_LAYER) && dur_i > duration) duration = dur_i; - } if (dur_i > maxDuration) maxDuration = dur_i; |