summaryrefslogtreecommitdiff
path: root/gtk2_ardour/time_axis_view.cc
diff options
context:
space:
mode:
authorNick Mainsbridge <beatroute@iprimus.com.au>2008-10-04 08:23:29 +0000
committerNick Mainsbridge <beatroute@iprimus.com.au>2008-10-04 08:23:29 +0000
commitf138091f7e6413623390cd2168aaac7d0a7d71c2 (patch)
tree2ac78d0cba4edaab208bb2724ddc13d28c819093 /gtk2_ardour/time_axis_view.cc
parent51f2a5fc4ee73752cb635db913769f9d47941933 (diff)
Improve scrolling performance for sessions containing hundreds of regions over many tracks by hiding offscreen tracks (scroll faster by making tracks larger, exposing fewer of them). Use distance from screen edges to drive autoscrolling distance. Avoid using canvas coordinates for displacement calculations where possible. Don't redisplay tempo in the colour handler.
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3853 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/time_axis_view.cc')
-rw-r--r--gtk2_ardour/time_axis_view.cc35
1 files changed, 17 insertions, 18 deletions
diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc
index 0ca20e4670..88d585ddc2 100644
--- a/gtk2_ardour/time_axis_view.cc
+++ b/gtk2_ardour/time_axis_view.cc
@@ -222,29 +222,15 @@ TimeAxisView::show_at (double y, int& nth, VBox *parent)
order = nth;
if (y_position != y) {
- /* the coordinates used here are in the system of the
- item's parent ...
- */
- Group* pg;
- double ix1, iy1, ix2, iy2;
- canvas_display->get_bounds (ix1, iy1, ix2, iy2);
- iy1 += editor.get_trackview_group_vertical_offset ();
- pg = canvas_display->property_parent();
- pg->i2w (ix1, iy1);
-
- if (iy1 < 0) {
- iy1 = 0;
- }
-
- canvas_display->move (0.0, y - iy1);
+ canvas_display->property_y () = y;
+ /* silly canvas */
+ canvas_display->move (0.0, 0.0);
y_position = y;
-
}
canvas_display->raise_to_top ();
if (_marked_for_display) {
- canvas_display->show();
controls_frame.show ();
controls_ebox.show ();
}
@@ -266,6 +252,19 @@ TimeAxisView::show_at (double y, int& nth, VBox *parent)
return effective_height;
}
+void
+TimeAxisView::clip_to_viewport ()
+{
+ if (_marked_for_display) {
+ if (y_position + effective_height < editor.get_trackview_group_vertical_offset () || y_position > editor.get_trackview_group_vertical_offset () + canvas_display->get_canvas()->get_height()) {
+ canvas_display->hide ();
+ return;
+ }
+ canvas_display->show ();
+ }
+ return;
+}
+
bool
TimeAxisView::controls_ebox_scroll (GdkEventScroll* ev)
{
@@ -380,8 +379,8 @@ TimeAxisView::set_height(uint32_t h)
if (h == height) {
return;
}
- controls_frame.property_height_request () = h;
height = h;
+ controls_frame.property_height_request () = h;
if (canvas_item_visible (selection_group)) {
/* resize the selection rect */