- BOOST_FOREACH(const shared_ptr<Signal> s, sigs)
- if(s->selected())
- s->set_v_offset(
- _mouse_down_signal_offsets[s.get()] +
- delta);
+ for (std::list<std::pair<boost::weak_ptr<Signal>,
+ int> >::iterator i = _drag_sigs.begin();
+ i != _drag_sigs.end(); i++) {
+ const boost::shared_ptr<Signal> sig((*i).first);
+ if (sig) {
+ const int y = (*i).second + delta;
+ const int y_snap =
+ ((y + View::SignalSnapGridSize / 2) /
+ View::SignalSnapGridSize) *
+ View::SignalSnapGridSize;
+ sig->set_v_offset(y_snap);
+
+ // Ensure the signal is selected
+ sig->select();
+ }
+
+ }