From 539deb1065f2c863ccc824b692282533eedab77e Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Mon, 29 Dec 2014 10:55:02 +0000 Subject: [PATCH] ViewWidget: Fixed glitching when drag is within the manhattan distance --- pv/view/viewwidget.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pv/view/viewwidget.cpp b/pv/view/viewwidget.cpp index a5174bb..cf73766 100644 --- a/pv/view/viewwidget.cpp +++ b/pv/view/viewwidget.cpp @@ -264,15 +264,19 @@ void ViewWidget::mouseMoveEvent(QMouseEvent *event) if (!(event->buttons() & Qt::LeftButton)) return; - if ((event->pos() - mouse_down_point_).manhattanLength() < - QApplication::startDragDistance()) - return; + if (!item_dragging_) + { + if ((event->pos() - mouse_down_point_).manhattanLength() < + QApplication::startDragDistance()) + return; - if (!accept_drag()) - return; + if (!accept_drag()) + return; + + item_dragging_ = true; + } // Do the drag - item_dragging_ = true; drag_items(event->pos() - mouse_down_point_); update(); -- 2.30.2