diff options
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/editor_canvas.cc | 26 | ||||
-rw-r--r-- | gtk2_ardour/editor_drag.cc | 11 | ||||
-rw-r--r-- | gtk2_ardour/editor_tempodisplay.cc | 5 | ||||
-rw-r--r-- | gtk2_ardour/public_editor.h | 1 | ||||
-rw-r--r-- | gtk2_ardour/tempo_lines.cc | 10 | ||||
-rw-r--r-- | gtk2_ardour/time_axis_view.cc | 2 |
7 files changed, 22 insertions, 35 deletions
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index a508e1d080..558f24f31c 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -1016,8 +1016,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD bool deferred_control_scroll (framepos_t); sigc::connection control_scroll_connection; - gdouble get_trackview_group_vertical_offset () const { return vertical_adjustment.get_value (); } - ArdourCanvas::Group* get_background_group () const { return _background_group; } ArdourCanvas::Group* get_trackview_group () const { return _trackview_group; } void tie_vertical_scrolling (); diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index 3f0098dcd0..faaae52ff6 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -33,6 +33,7 @@ #include "canvas/rectangle.h" #include "canvas/pixbuf.h" #include "canvas/text.h" +#include "canvas/debug.h" #include "ardour_ui.h" #include "editor.h" @@ -101,10 +102,14 @@ Editor::initialize_canvas () _background_group = new ArdourCanvas::Group (_track_canvas->root()); + CANVAS_DEBUG_NAME (_background_group, "Canvas Background"); _master_group = new ArdourCanvas::Group (_track_canvas->root()); + CANVAS_DEBUG_NAME (_master_group, "Canvas Master"); _trackview_group = new ArdourCanvas::Group (_master_group); + CANVAS_DEBUG_NAME (_trackview_group, "Canvas TrackViews"); _region_motion_group = new ArdourCanvas::Group (_trackview_group); + CANVAS_DEBUG_NAME (_region_motion_group, "Canvas Region Motion"); meter_bar_group = new ArdourCanvas::Group (_time_bars_canvas->root ()); meter_bar = new ArdourCanvas::Rectangle (meter_bar_group, ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, timebar_height - 1)); @@ -487,7 +492,7 @@ Editor::maybe_autoscroll (bool allow_horiz, bool allow_vert, bool moving_left, b /* Note whether we're fudging the autoscroll (see autoscroll_fudge_threshold) */ _autoscroll_fudging = (distance < autoscroll_fudge_threshold ()); - double const ty = _drags->current_pointer_y() - get_trackview_group_vertical_offset (); + double const ty = _drags->current_pointer_y(); autoscroll_y = 0; autoscroll_x = 0; @@ -558,7 +563,7 @@ Editor::autoscroll_canvas () if (autoscroll_y_distance != 0) { if (autoscroll_y > 0) { - autoscroll_y_distance = (_drags->current_pointer_y() - (get_trackview_group_vertical_offset() + _visible_canvas_height)) / 3; + autoscroll_y_distance = (_drags->current_pointer_y() - _visible_canvas_height) / 3; } else if (autoscroll_y < 0) { autoscroll_y_distance = (vertical_adjustment.get_value () - _drags->current_pointer_y()) / 3; @@ -754,23 +759,6 @@ Editor::set_horizontal_position (double p) HorizontalPositionChanged (); /* EMIT SIGNAL */ } -// CAIROCANVAS -#if 0 -void -Editor::scroll_canvas_vertically () -{ - /* vertical scrolling only */ - - double y_delta; - - y_delta = last_trackview_group_vertical_offset - get_trackview_group_vertical_offset (); - _trackview_group->move (0, y_delta); - _background_group->move (0, y_delta); - - last_trackview_group_vertical_offset = get_trackview_group_vertical_offset (); -} -#endif - void Editor::color_handler() { diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index d753d59551..1b9a820ae6 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -670,12 +670,16 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move) /* Reparent to a non scrolling group so that we can keep the region selection above all time axis views. Reparenting means that we will have to move the region view - later, as the two parent groups have different coordinates. + within its new parent, as the two parent groups have different coordinates. */ + ArdourCanvas::Group* rvg = rv->get_canvas_group(); + Duple rv_canvas_offset = rvg->item_to_canvas (Duple (0,0)); + rv->get_canvas_group()->reparent (_editor->_region_motion_group); - + rv->fake_set_opaque (true); + rvg->set_position (rv_canvas_offset); } /* If we have moved tracks, we'll fudge the layer delta so that the @@ -725,8 +729,7 @@ RegionMotionDrag::motion (GdkEvent* event, bool first_move) /* Get the y coordinate of the top of the track that this region is now on */ tv->canvas_display()->item_to_canvas (x, y); - y += _editor->get_trackview_group_vertical_offset(); - + /* And adjust for the layer that it should be on */ StreamView* cv = tv->view (); switch (cv->layer_display ()) { diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc index 30aab87d05..b717ef5464 100644 --- a/gtk2_ardour/editor_tempodisplay.cc +++ b/gtk2_ardour/editor_tempodisplay.cc @@ -193,9 +193,8 @@ Editor::draw_measures (ARDOUR::TempoMap::BBTPointList::const_iterator& begin, if (tempo_lines == 0) { tempo_lines = new TempoLines (*_track_canvas_viewport, time_line_group, physical_screen_height(get_window())); } - - // CAIROCANVAS - // tempo_lines->draw (begin, end, frames_per_unit); + + tempo_lines->draw (begin, end, samples_per_pixel); } void diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 9fbf4533b4..42ff531a35 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -380,7 +380,6 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible { virtual Gtk::HBox& get_status_bar_packer() = 0; #endif - virtual gdouble get_trackview_group_vertical_offset () const = 0; virtual ArdourCanvas::Group* get_trackview_group () const = 0; virtual ArdourCanvas::Group* get_background_group () const = 0; diff --git a/gtk2_ardour/tempo_lines.cc b/gtk2_ardour/tempo_lines.cc index 5cb059cbee..cd923d88a9 100644 --- a/gtk2_ardour/tempo_lines.cc +++ b/gtk2_ardour/tempo_lines.cc @@ -123,11 +123,11 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin, // Tempo map hasn't changed and we're entirely within a clean // range, don't need to do anything. Yay. if (needed_left >= _clean_left && needed_right <= _clean_right) { - // cout << endl << "*** LINE CACHE PERFECT HIT" << endl; + // cerr << endl << "*** LINE CACHE PERFECT HIT" << endl; return; } - //cout << endl << "*** LINE CACHE MISS" << endl; + // cerr << endl << "*** LINE CACHE MISS" << endl; bool invalidated = false; @@ -169,7 +169,7 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin, // Steal from the right if (left->first > needed_left && li != steal && steal->first > needed_right) { - //cout << "*** STEALING FROM RIGHT" << endl; + // cerr << "*** STEALING FROM RIGHT" << endl; double const x = steal->first; line = steal->second; _lines.erase(steal); @@ -208,7 +208,7 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin, // Create a new line } else if (_lines.size() < needed || _lines.size() < MAX_CACHED_LINES) { - //cout << "*** CREATING LINE" << endl; + // cerr << "*** CREATING LINE" << endl; /* if we already have a line there ... don't sweat it */ if (_lines.find (xpos) == _lines.end()) { line = new ArdourCanvas::Line (_group); @@ -222,7 +222,7 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin, // Steal from the left } else { - //cout << "*** STEALING FROM LEFT" << endl; + // cerr << "*** STEALING FROM LEFT" << endl; if (_lines.find (xpos) == _lines.end()) { Lines::iterator steal = _lines.begin(); double const x = steal->first; diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 433eee350d..a426656cf6 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -373,7 +373,7 @@ TimeAxisView::controls_ebox_motion (GdkEventMotion* ev) */ int tx, ty; controls_ebox.translate_coordinates (*control_parent, ev->x, ev->y, tx, ty); - ev->y = ty - _editor.get_trackview_group_vertical_offset(); + ev->y = ty; _editor.drags()->motion_handler ((GdkEvent *) ev, false); _editor.maybe_autoscroll (false, true, false, ev->y_root < _resize_drag_start); |