diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-04-19 02:11:39 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-04-19 02:11:39 +0000 |
commit | 74e6e37d3038cfe45b856d92576b66aca519f43f (patch) | |
tree | 71763925dfb3f1ff26516f489a028b83655096e9 /gtk2_ardour/editor_canvas.cc | |
parent | 099c4c8d064dce9f0517ae3e32d694a19d580d71 (diff) |
a) fix editor hscroller to follow PT behaviour - scrollbar always
covers 0...full session + 10% of current zoom page size
b) add "big meter" mode to tranzport and fix more bugs with tranzport
support
git-svn-id: svn://localhost/trunk/ardour2@455 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_canvas.cc')
-rw-r--r-- | gtk2_ardour/editor_canvas.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index 92844124bd..73e6e22668 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -312,6 +312,7 @@ Editor::track_canvas_allocate (Gtk::Allocation alloc) edit_cursor->set_position (edit_cursor->current_frame); playhead_cursor->set_position (playhead_cursor->current_frame); + reset_hscrollbar_stepping (); reset_scrolling_region (); if (edit_cursor) edit_cursor->set_length (canvas_height); @@ -374,14 +375,22 @@ Editor::reset_scrolling_region (Gtk::Allocation* alloc) } } - double last_canvas_unit = ceil ((double) max_frames / frames_per_unit); + // old: ceil ((double) max_frames / frames_per_unit); + + double last_canvas_unit; + + if (session) { + last_canvas_unit = (session->get_maximum_extent() + (current_page_frames() * 0.10f)) / frames_per_unit; + } else { + last_canvas_unit = 0; + } + track_canvas.set_scroll_region (0.0, 0.0, max (last_canvas_unit, canvas_width), pos); // XXX what is the correct height value for the time canvas ? this overstates it time_canvas.set_scroll_region ( 0.0, 0.0, max (last_canvas_unit, canvas_width), canvas_height); controls_layout.queue_resize(); - } void @@ -522,3 +531,4 @@ Editor::drop_regions (const RefPtr<Gdk::DragContext>& context, context->drag_finish (true, false, time); } + |