+
+ if (!(event->buttons() & Qt::LeftButton))
+ return;
+
+ if ((event->pos() - _mouse_down_point).manhattanLength() <
+ QApplication::startDragDistance())
+ return;
+
+ // Move the signals if we are dragging
+ if (!_drag_traces.empty())
+ {
+ _dragging = true;
+
+ const int delta = event->pos().y() - _mouse_down_point.y();
+
+ for (auto i = _drag_traces.begin(); i != _drag_traces.end(); i++) {
+ const std::shared_ptr<Trace> trace((*i).first);
+ if (trace) {
+ const int y = (*i).second + delta;
+ const int y_snap =
+ ((y + View::SignalSnapGridSize / 2) /
+ View::SignalSnapGridSize) *
+ View::SignalSnapGridSize;
+ trace->set_v_offset(y_snap);
+
+ // Ensure the trace is selected
+ trace->select();
+ }
+
+ }
+
+ signals_moved();
+ }
+