diff options
author | Carl Hetherington <carl@carlh.net> | 2010-05-09 20:48:21 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-05-09 20:48:21 +0000 |
commit | 792e3de1d4cb291a02c5c31dad54028049bafed9 (patch) | |
tree | e65183deeb01752110a59a5b834e06deef811dab /gtk2_ardour/editor_canvas.cc | |
parent | acfc44f3889704587ff281c6348523b2811e7c2e (diff) |
Create the session range location as and when the session first gets some content. Allows both the beginning and end of the range to expand to contain the actual session contents.
git-svn-id: svn://localhost/ardour2/branches/3.0@7087 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_canvas.cc')
-rw-r--r-- | gtk2_ardour/editor_canvas.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index 52e381b032..b072a2779e 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -780,20 +780,18 @@ Editor::tie_vertical_scrolling () void Editor::set_horizontal_position (double p) { - _horizontal_position = p; - /* horizontal scrolling only */ double x1, y1, x2, y2, x_delta; _master_group->get_bounds (x1, y1, x2, y2); - x_delta = - (x1 + _horizontal_position); + x_delta = - (x1 + p); _master_group->move (x_delta, 0); timebar_group->move (x_delta, 0); time_line_group->move (x_delta, 0); cursor_group->move (x_delta, 0); - leftmost_frame = (nframes64_t) floor (_horizontal_position * frames_per_unit); + leftmost_frame = (nframes64_t) floor (p * frames_per_unit); update_fixed_rulers (); redisplay_tempo (true); @@ -921,3 +919,9 @@ Editor::update_canvas_now () track_canvas->update_now (); } } + +double +Editor::horizontal_position () const +{ + return frame_to_unit (leftmost_frame); +} |