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:
@@ -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_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user