diff options
author | Robin Gareus <robin@gareus.org> | 2015-03-26 03:04:19 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-03-26 23:30:18 +0100 |
commit | 502361c00188d41f868e6460da7cc646c3013e9a (patch) | |
tree | d33f1a4600b29d628e112372df6c92a2effd4392 | |
parent | 5c11e43f083ca6a184000ff61274a99ddf5f57c4 (diff) |
DnD: query mouse y-pos only once.
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index d47109303b..30e89bdc76 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -790,10 +790,12 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move) /* Find the TimeAxisView that the pointer is now over */ - pair<TimeAxisView*, double> const r = _editor->trackview_by_y_position (current_pointer_y ()); + const double cur_y = current_pointer_y (); + + pair<TimeAxisView*, double> const r = _editor->trackview_by_y_position (cur_y); TimeAxisView* tv = r.first; - if (!tv && current_pointer_y() < 0) { + if (!tv && cur_y < 0) { /* above trackview area, autoscroll hasn't moved us since last time, nothing to do */ return; } @@ -859,7 +861,7 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move) } /* for automation lanes, there is a TimeAxisView but no ->view() */ - else if (!tv && current_pointer_y() >= 0 && _last_pointer_time_axis_view >= 0) { + else if (!tv && cur_y >= 0 && _last_pointer_time_axis_view >= 0) { /* Moving into the drop-zone.. * * TODO allow moving further down in drop-zone: @@ -1004,7 +1006,7 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move) printf("IN THE ZONE\n"); #endif assert(i->time_axis_view >= _time_axis_views.size()); - if (current_pointer_y() >= 0) { + if (cur_y >= 0) { int dzoffset; NewTrackIndexAndPosition ip; |