From 51c333a7b3abe11dbe5c20234d92eb1ff16a30bb Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 12 Jan 2008 03:56:43 +0000 Subject: more NSD madness curing; fix up canvas range rects and marker line height mgmt git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2902 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_canvas.cc | 56 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 11 deletions(-) (limited to 'gtk2_ardour/editor_canvas.cc') diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index 4e8858b84c..c89c196a88 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -317,25 +317,27 @@ Editor::track_canvas_size_allocated () reset_scrolling_region (); if (playhead_cursor) playhead_cursor->set_length (canvas_height); + + double y1 = vertical_adjustment.get_value (); for (MarkerSelection::iterator x = selection->markers.begin(); x != selection->markers.end(); ++x) { - (*x)->set_line_length (full_canvas_height); + (*x)->set_line_vpos (y1, canvas_height); } - range_marker_drag_rect->property_y2() = full_canvas_height; - transport_loop_range_rect->property_y2() = full_canvas_height; - transport_punch_range_rect->property_y2() = full_canvas_height; - transport_punchin_line->property_y2() = full_canvas_height; - transport_punchout_line->property_y2() = full_canvas_height; + range_marker_drag_rect->property_y1() = y1; + range_marker_drag_rect->property_y2() = y1 + canvas_height; + transport_loop_range_rect->property_y1() = y1; + transport_loop_range_rect->property_y2() = y1 + canvas_height; + transport_punch_range_rect->property_y1() = y1; + transport_punch_range_rect->property_y2() = y1 + canvas_height; + transport_punchin_line->property_y1() = y1; + transport_punchin_line->property_y2() = y1 + canvas_height; + transport_punchout_line->property_y1() = y1; + transport_punchout_line->property_y2() = y1 + canvas_height; update_fixed_rulers(); redisplay_tempo (true); - if (logo_item) { - // logo_item->property_height() = full_canvas_height; - // logo_item->property_width() = canvas_width; - } - Resized (); /* EMIT_SIGNAL */ return false; @@ -682,6 +684,38 @@ Editor::left_track_canvas (GdkEventCrossing *ev) return FALSE; } +void +Editor::tie_vertical_scrolling () +{ + double y1 = vertical_adjustment.get_value(); + + playhead_cursor->set_y_axis (y1); + + range_marker_drag_rect->property_y1() = y1; + range_marker_drag_rect->property_y2() = y1 + canvas_height; + transport_loop_range_rect->property_y1() = y1; + transport_loop_range_rect->property_y2() = y1 + canvas_height; + transport_punch_range_rect->property_y1() = y1; + transport_punch_range_rect->property_y2() = y1 + canvas_height; + transport_punchin_line->property_y1() = y1; + transport_punchin_line->property_y2() = y1 + canvas_height; + transport_punchout_line->property_y1() = y1; + transport_punchout_line->property_y2() = y1 + canvas_height; + + if (!selection->markers.empty()) { + for (MarkerSelection::iterator x = selection->markers.begin(); x != selection->markers.end(); ++x) { + (*x)->set_line_vpos (y1, canvas_height); + } + } + + if (logo_item) { + logo_item->property_y() = y1; + } + + /* this will do an immediate redraw */ + + controls_layout.get_vadjustment()->set_value (y1); +} void Editor::canvas_horizontally_scrolled () -- cgit v1.2.3