reinstate a canvas group where we reparent regions while dragging, so that they are always on top.

I mistakenly removed this during the onecanvas changes.
This commit is contained in:
Paul Davis 2014-06-05 15:16:55 -04:00
parent ef9bf58359
commit ad346dc638
5 changed files with 28 additions and 1 deletions

View File

@ -744,6 +744,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
/* The group containing all trackviews. */
ArdourCanvas::Group* _trackview_group;
/* The group holding things (mostly regions) while dragging so they
* are on top of everything else
*/
ArdourCanvas::Group* _drag_motion_group;
/* a rect that sits at the bottom of all tracks to act as a drag-no-drop/clickable
* target area.
*/

View File

@ -118,6 +118,12 @@ Editor::initialize_canvas ()
_trackview_group = new ArdourCanvas::Group (hv_scroll_group);
CANVAS_DEBUG_NAME (_trackview_group, "Canvas TrackViews");
/* a group to hold stuff while it gets dragged around. Must be the
* uppermost (last) group with hv_scroll_group as a parent
*/
_drag_motion_group = new ArdourCanvas::Group (hv_scroll_group);
CANVAS_DEBUG_NAME (_drag_motion_group, "Canvas Drag Motion");
/* TIME BAR CANVAS */
_time_markers_group = new ArdourCanvas::Group (h_scroll_group);

View File

@ -704,7 +704,16 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move)
if (first_move) {
rv->drag_start ();
rv->fake_set_opaque (true);
rv->raise_to_top ();
/* reparent the regionview into a group above all
* others
*/
ArdourCanvas::Group* rvg = rv->get_canvas_group();
Duple rv_canvas_offset = rvg->parent()->item_to_canvas (Duple (0,0));
Duple dmg_canvas_offset = _editor->_drag_motion_group->item_to_canvas (Duple (0,0));
rv->get_canvas_group()->reparent (_editor->_drag_motion_group);
rvg->move (rv_canvas_offset - dmg_canvas_offset);
}
/* If we have moved tracks, we'll fudge the layer delta so that the

View File

@ -1044,3 +1044,9 @@ TimeAxisViewItem::parameter_changed (string p)
set_frame_gradient ();
}
}
void
TimeAxisViewItem::visual_raise_to_top ()
{
group->raise_to_top ();
}

View File

@ -76,6 +76,7 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
void set_name_text_color ();
uint32_t get_fill_color () const;
void visual_raise_to_top ();
ArdourCanvas::Item* get_canvas_frame();
ArdourCanvas::Group* get_canvas_group();