diff options
author | Mahmoud Badri <mahmoud.badri@qt.io> | 2018-05-28 16:25:11 +0300 |
---|---|---|
committer | Mahmoud Badri <mahmoud.badri@qt.io> | 2018-05-29 10:12:48 +0000 |
commit | 2220d525ba1a07d6c1d4e6b5f6c7f363be9c21c7 (patch) | |
tree | 261f5a015e90bbd381d928ec4bf8b87d1a1da92a | |
parent | 32aaf15967a91b04c94038dd570f7deed2fa8f4f (diff) |
Fix incorrect duration jump glitch
While dragging a row duration, at the point when the horizontal
scrollbar appears, the duration bar jumps far away for 1 frame.
Task-number: QT3DS-1806
Change-Id: Ia6486c87fed891c2bf555ffd18d8bcc3f2566ec9
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r-- | src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp index dc200366..14b6dfa0 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp @@ -424,14 +424,16 @@ void TimelineGraphicsScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) if (shift) snap(distance); m_editedTimelineRow->setStartX(distance); - } else if (m_clickedTimelineControlType == TimelineControlType::EndHandle) { + } else if (m_clickedTimelineControlType == TimelineControlType::EndHandle + && qAbs(event->scenePos().x() - event->lastScenePos().x()) < 50) { // resizing layer timline duration from right double distance = event->scenePos().x() - m_ruler->pos().x(); if (shift) snap(distance); m_editedTimelineRow->setEndX(distance); rowManager()->updateRulerDuration(); - } else if (m_clickedTimelineControlType == TimelineControlType::Duration) { + } else if (m_clickedTimelineControlType == TimelineControlType::Duration + && qAbs(event->scenePos().x() - event->lastScenePos().x()) < 50) { // moving layer timeline duration double newX = event->scenePos().x() - m_editedTimelineRow->getDurationMoveOffsetX() - m_ruler->x(); |