probable fix for a region drag that somehow ends up with no time axis view (track) under the mouse (e.g. during a track height reduction
This commit is contained in:
parent
3031a99364
commit
8ee0671fd9
@ -519,9 +519,11 @@ RegionDrag::find_time_axis_view (TimeAxisView* t) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
RegionMotionDrag::RegionMotionDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, list<RegionView*> const & v, bool b)
|
RegionMotionDrag::RegionMotionDrag (Editor* e, ArdourCanvas::Item* i, RegionView* p, list<RegionView*> const & v, bool b)
|
||||||
: RegionDrag (e, i, p, v),
|
: RegionDrag (e, i, p, v)
|
||||||
_brushing (b),
|
, _brushing (b)
|
||||||
_total_x_delta (0)
|
, _total_x_delta (0)
|
||||||
|
, _last_pointer_time_axis_view (0)
|
||||||
|
, _last_pointer_layer (0)
|
||||||
{
|
{
|
||||||
DEBUG_TRACE (DEBUG::Drags, "New RegionMotionDrag\n");
|
DEBUG_TRACE (DEBUG::Drags, "New RegionMotionDrag\n");
|
||||||
}
|
}
|
||||||
@ -534,8 +536,10 @@ RegionMotionDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
|
|||||||
show_verbose_cursor_time (_last_frame_position);
|
show_verbose_cursor_time (_last_frame_position);
|
||||||
|
|
||||||
pair<TimeAxisView*, double> const tv = _editor->trackview_by_y_position (_drags->current_pointer_y ());
|
pair<TimeAxisView*, double> const tv = _editor->trackview_by_y_position (_drags->current_pointer_y ());
|
||||||
_last_pointer_time_axis_view = find_time_axis_view (tv.first);
|
if (tv.first) {
|
||||||
_last_pointer_layer = tv.first->layer_display() == Overlaid ? 0 : tv.second;
|
_last_pointer_time_axis_view = find_time_axis_view (tv.first);
|
||||||
|
_last_pointer_layer = tv.first->layer_display() == Overlaid ? 0 : tv.second;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
double
|
double
|
||||||
@ -642,17 +646,18 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move)
|
|||||||
/* Find the TimeAxisView that the pointer is now over */
|
/* Find the TimeAxisView that the pointer is now over */
|
||||||
pair<TimeAxisView*, double> const tv = _editor->trackview_by_y_position (_drags->current_pointer_y ());
|
pair<TimeAxisView*, double> const tv = _editor->trackview_by_y_position (_drags->current_pointer_y ());
|
||||||
|
|
||||||
if (first_move && tv.first->view()->layer_display() == Stacked) {
|
|
||||||
tv.first->view()->set_layer_display (Expanded);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Bail early if we're not over a track */
|
/* Bail early if we're not over a track */
|
||||||
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (tv.first);
|
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (tv.first);
|
||||||
|
|
||||||
if (!rtv || !rtv->is_track()) {
|
if (!rtv || !rtv->is_track()) {
|
||||||
_editor->verbose_cursor()->hide ();
|
_editor->verbose_cursor()->hide ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (first_move && tv.first->view()->layer_display() == Stacked) {
|
||||||
|
tv.first->view()->set_layer_display (Expanded);
|
||||||
|
}
|
||||||
|
|
||||||
/* Note: time axis views in this method are often expressed as an index into the _time_axis_views vector */
|
/* Note: time axis views in this method are often expressed as an index into the _time_axis_views vector */
|
||||||
|
|
||||||
/* Here's the current pointer position in terms of time axis view and layer */
|
/* Here's the current pointer position in terms of time axis view and layer */
|
||||||
|
Loading…
Reference in New Issue
Block a user