From: Joel Holdsworth Date: Mon, 29 Dec 2014 10:55:02 +0000 (+0000) Subject: ViewWidget: Fixed glitching when drag is within the manhattan distance X-Git-Tag: pulseview-0.3.0~295 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=539deb1065f2c863ccc824b692282533eedab77e ViewWidget: Fixed glitching when drag is within the manhattan distance --- diff --git a/pv/view/viewwidget.cpp b/pv/view/viewwidget.cpp index a5174bb3..cf737664 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();