timebasedviews: only drag playhead when there's no item underneath the cursor

This commit is contained in:
itsmattkc
2021-01-24 09:36:05 +11:00
parent 62bab2ec01
commit eb132d93de
4 changed files with 32 additions and 19 deletions
+3 -3
View File
@@ -113,7 +113,9 @@ KeyframeViewItem *KeyframeViewBase::AddKeyframeInternal(NodeKeyframe* key)
void KeyframeViewBase::mousePressEvent(QMouseEvent *event)
{
if (HandPress(event) || PlayheadPress(event)) {
QGraphicsItem* item_under_cursor = itemAt(event->pos());
if (HandPress(event) || (!item_under_cursor && PlayheadPress(event))) {
return;
}
@@ -123,8 +125,6 @@ void KeyframeViewBase::mousePressEvent(QMouseEvent *event)
QGraphicsView::mousePressEvent(event);
if (active_tool_ == Tool::kPointer) {
QGraphicsItem* item_under_cursor = itemAt(event->pos());
if (item_under_cursor) {
drag_start_ = event->pos();