summaryrefslogtreecommitdiff
path: root/gtk2_ardour/streamview.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-04-15 13:50:05 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-04-15 13:50:05 -0400
commit7e19053b88b4ab174052a44f2ee99dce92517aa9 (patch)
treed996b22ac8661421cc661d336322923deda00f73 /gtk2_ardour/streamview.cc
parentaf4539f857a14be3856da89a20811bf39e4ffb6e (diff)
Fix dragging objects on the canvas and remove redundant canvas groups
Delivery of fake motion events to the editor needed the event coordinates to be in canvas space, as they are with "real" events. Editor and other objects had many redundant groups from timbyr's work on gnomecanvas to scroll by moving groups. We don't need this anymore with cairo-canvas (though possibly a stationay background group for the canvas might be useful again one day as in the SAE logo. Its implementation would be fairly different though, since we would have to explicitly move the group on every scroll, since nothing else ever moves on scroll). Also tweaks to text item placement, and switch TimeAxisViewItem from name_pixbuf to name_text, since ArdourCanvas::Text is already "pixbuf optimized".
Diffstat (limited to 'gtk2_ardour/streamview.cc')
-rw-r--r--gtk2_ardour/streamview.cc18
1 files changed, 3 insertions, 15 deletions
diff --git a/gtk2_ardour/streamview.cc b/gtk2_ardour/streamview.cc
index fac4572c92..774e150f13 100644
--- a/gtk2_ardour/streamview.cc
+++ b/gtk2_ardour/streamview.cc
@@ -50,12 +50,9 @@ using namespace ARDOUR;
using namespace PBD;
using namespace Editing;
-StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Group* background_group, ArdourCanvas::Group* canvas_group)
+StreamView::StreamView (RouteTimeAxisView& tv)
: _trackview (tv)
- , owns_background_group (background_group == 0)
- , owns_canvas_group (canvas_group == 0)
- , _background_group (background_group ? background_group : new ArdourCanvas::Group (_trackview.canvas_background()))
- , _canvas_group (canvas_group ? canvas_group : new ArdourCanvas::Group (_trackview.canvas_display()))
+ , _canvas_group (new ArdourCanvas::Group (_trackview.canvas_display()))
, _samples_per_pixel (_trackview.editor().get_current_zoom ())
, rec_updating(false)
, rec_active(false)
@@ -65,12 +62,11 @@ StreamView::StreamView (RouteTimeAxisView& tv, ArdourCanvas::Group* background_g
, height(tv.height)
, last_rec_data_frame(0)
{
- CANVAS_DEBUG_NAME (_background_group, string_compose ("SV background group %1", _trackview.name()));
CANVAS_DEBUG_NAME (_canvas_group, string_compose ("SV canvas group %1", _trackview.name()));
/* set_position() will position the group */
- canvas_rect = new ArdourCanvas::Rectangle (_background_group);
+ canvas_rect = new ArdourCanvas::Rectangle (_canvas_group);
CANVAS_DEBUG_NAME (canvas_rect, string_compose ("SV canvas rectangle %1", _trackview.name()));
canvas_rect->set (ArdourCanvas::Rect (0, 0, ArdourCanvas::COORD_MAX, tv.current_height ()));
canvas_rect->raise(1); // raise above tempo lines
@@ -99,14 +95,6 @@ StreamView::~StreamView ()
undisplay_track ();
delete canvas_rect;
-
- if (owns_background_group) {
- delete _background_group;
- }
-
- if (owns_canvas_group) {
- delete _canvas_group;
- }
}
void