Correct playhead position after releasing out of range

When dragging the playhead and releasing it out of the range of the
timeline, the playhead took wrong position.

This happens if the timeline does not start at frame 0. The value of
timeline.startKeyframe() is already taken into account by
mapFromFrameToScene() in setPosition(). Therefore the offset was
added twice.

Task-number: QDS-1074
Change-Id: I72ec13176af473ac9851580e2367117f98ddfc65
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
Mahmoud Badri
2019-09-23 16:22:24 +03:00
parent da39f3d7fc
commit 05d53c1454

View File

@@ -187,7 +187,7 @@ void TimelineGraphicsScene::setCurrentFrame(int frame)
if (timeline.isValid()) {
timeline.modelNode().setAuxiliaryData("currentFrame@NodeInstance", frame);
m_currentFrameIndicator->setPosition(frame + timeline.startKeyframe());
m_currentFrameIndicator->setPosition(frame);
} else {
m_currentFrameIndicator->setPosition(0);
}