timeline: treat non-primary clicks as non-moving

Fixes bug where drag would get stuck if the user right clicked on the
timeline.
This commit is contained in:
itsmattkc
2020-06-18 03:35:59 +10:00
parent 4b0e6f97f7
commit 5397457c8d
2 changed files with 9 additions and 1 deletions
@@ -893,6 +893,12 @@ void TimelineWidget::ViewMousePressed(TimelineViewMouseEvent *event)
if (GetConnectedNode() && active_tool_ != nullptr) {
active_tool_->MousePress(event);
}
if (event->GetButton() != Qt::LeftButton) {
// Suspend tool immediately if the cursor isn't the primary button
active_tool_->MouseRelease(event);
active_tool_ = nullptr;
}
}
void TimelineWidget::ViewMouseMoved(TimelineViewMouseEvent *event)
@@ -134,7 +134,9 @@ bool TimelineViewBase::PlayheadPress(QMouseEvent *event)
{
QPointF scene_pos = mapToScene(event->pos());
dragging_playhead_ = (scene_pos.x() >= playhead_scene_left_ && scene_pos.x() < playhead_scene_right_);
dragging_playhead_ = (event->button() == Qt::LeftButton
&& scene_pos.x() >= playhead_scene_left_
&& scene_pos.x() < playhead_scene_right_);
return dragging_playhead_;
}