ensure playhead cannot be dragged below 0 in the TimelineViewBase

This commit is contained in:
itsmattkc
2019-12-26 19:03:44 +11:00
parent 61c60e00d6
commit 5d82aa1a7d
@@ -89,7 +89,7 @@ bool TimelineViewBase::PlayheadMove(QMouseEvent *event)
QPointF scene_pos = mapToScene(event->pos());
rational mouse_time = SceneToTime(scene_pos.x());
int64_t target_ts = Timecode::time_to_timestamp(mouse_time, timebase());
int64_t target_ts = qMax(static_cast<int64_t>(0), Timecode::time_to_timestamp(mouse_time, timebase()));
SetTime(target_ts);
emit TimeChanged(target_ts);