diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-04-05 11:27:26 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-04-05 11:27:26 -0400 |
commit | 07a505b1b271f64a1ffb2da32da0548d32cd13de (patch) | |
tree | 82b5d1ac8a5e825791fbfcc5789f6fa0aba290ae /gtk2_ardour | |
parent | 7db5d68cdb1c7b6138907cb732e913ec91212e13 (diff) |
lots of tweaking and adding debug output including operator<</dump(ostream&) methods to help visualize canvas structure
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor.cc | 4 | ||||
-rw-r--r-- | gtk2_ardour/editor_canvas.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/editor_mouse.cc | 27 |
3 files changed, 21 insertions, 12 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index bbf4ccde49..bde5b65893 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -496,7 +496,7 @@ Editor::Editor () _cursors = new MouseCursors; - ArdourCanvas::Canvas* time_pad = new ArdourCanvas::GtkCanvas (); + ArdourCanvas::GtkCanvas* time_pad = manage (new ArdourCanvas::GtkCanvas ()); ArdourCanvas::Line* pad_line_1 = new ArdourCanvas::Line (time_pad->root()); pad_line_1->set (ArdourCanvas::Duple (0.0, 1.0), ArdourCanvas::Duple (100.0, 1.0)); @@ -504,7 +504,7 @@ Editor::Editor () pad_line_1->show(); // CAIROCANVAS - //time_pad->show(); + time_pad->show(); time_canvas_vbox.set_size_request (-1, (int)(timebar_height * visible_timebars) + 2); time_canvas_vbox.set_size_request (-1, -1); diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index a8de8266a5..4b9b21dc5c 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -275,6 +275,8 @@ Editor::track_canvas_viewport_size_allocated () _visible_canvas_width = _canvas_viewport_allocation.get_width (); _visible_canvas_height = _canvas_viewport_allocation.get_height (); + cerr << "VISIBLE CANVAS now: " << _visible_canvas_width << " x " << _visible_canvas_height << endl; + if (_session) { TrackViewList::iterator i; diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 3ab2e95f56..de22451422 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -308,19 +308,26 @@ Editor::set_canvas_cursor () /* up-down cursor as a cue that automation can be dragged up and down when in join object/range mode */ if (!_internal_editing && get_smart_mode() ) { + double x, y; get_pointer_position (x, y); - vector<ArdourCanvas::Item const *> items; - _track_canvas->root()->add_items_at_point (ArdourCanvas::Duple (x,y), items); - - // CAIROCANVAS: need upper-most item, not all items - if (!items.empty()) { - const ArdourCanvas::Item* i = items.front(); - if (i && i->parent() && i->parent()->get_data (X_("timeselection"))) { - pair<TimeAxisView*, int> tvp = trackview_by_y_position (_last_motion_y + vertical_adjustment.get_value()); - if (dynamic_cast<AutomationTimeAxisView*> (tvp.first)) { - current_canvas_cursor = _cursors->up_down; + if (x >= 0 && y >= 0) { + + vector<ArdourCanvas::Item const *> items; + + _track_canvas->root()->add_items_at_point (ArdourCanvas::Duple (x,y), items); + + // first item will be the upper most + + if (!items.empty()) { + const ArdourCanvas::Item* i = items.front(); + + if (i && i->parent() && i->parent()->get_data (X_("timeselection"))) { + pair<TimeAxisView*, int> tvp = trackview_by_y_position (_last_motion_y + vertical_adjustment.get_value()); + if (dynamic_cast<AutomationTimeAxisView*> (tvp.first)) { + current_canvas_cursor = _cursors->up_down; + } } } } |