diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2016-01-07 10:30:29 +1000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2016-01-21 11:25:55 +1000 |
commit | c6805c1454f9dea518d7ba0f0eb4ecee1a1c6906 (patch) | |
tree | d4ef03fadccc8845b9b5b40f8241b198963eec56 /gtk2_ardour/editor_ops.cc | |
parent | cd377f1278c98465497b05cef1804cf140dbbb7c (diff) |
Refactor scrolling track canvas in Editor class into two utility methods
Diffstat (limited to 'gtk2_ardour/editor_ops.cc')
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index cb67f1fc20..33e5e80efa 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -1589,6 +1589,31 @@ Editor::scroll_up_one_track (bool skip_child_views) return false; } +void +Editor::scroll_left_step () +{ + framepos_t xdelta = (current_page_samples() / 8); + + if (leftmost_frame > xdelta) { + reset_x_origin (leftmost_frame - xdelta); + } else { + reset_x_origin (0); + } +} + + +void +Editor::scroll_right_step () +{ + framepos_t xdelta = (current_page_samples() / 8); + + if (max_framepos - xdelta > leftmost_frame) { + reset_x_origin (leftmost_frame + xdelta); + } else { + reset_x_origin (max_framepos - current_page_samples()); + } +} + /* ZOOM */ void |