]> sigrok.org Git - pulseview.git/commitdiff
ViewWidget: Fixed glitching when drag is within the manhattan distance
authorJoel Holdsworth <redacted>
Mon, 29 Dec 2014 10:55:02 +0000 (10:55 +0000)
committerJoel Holdsworth <redacted>
Mon, 29 Dec 2014 12:24:23 +0000 (12:24 +0000)
pv/view/viewwidget.cpp

index a5174bb37ecd000332a199cea5790a7792e83770..cf7376646586f2a88d9eb5d9680808fd407635af 100644 (file)
@@ -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();