diff options
author | Carl Hetherington <carl@carlh.net> | 2010-01-06 01:37:38 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-01-06 01:37:38 +0000 |
commit | 8418f8cea6a66991b4a4c591c25102cb77ce3a55 (patch) | |
tree | 50e510d0a0316d46d577977852c810a9bd1ecab2 /gtk2_ardour | |
parent | ea7cb51ed8f7193de6e800bc482ffa30c18047f4 (diff) |
Clean up the idle_visual_changer a bit, fixing a bug where the playhead would jump around when zooming a lot with playhead zoom focus.
git-svn-id: svn://localhost/ardour2/branches/3.0@6462 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor.cc | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index fd6d8a991f..9f7128a76a 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -4325,38 +4325,25 @@ Editor::idle_visual_changer () update_tempo_based_rulers (); } if (p & VisualChange::TimeOrigin) { + // Add a little extra so we can see the end marker + nframes64_t e = 0; + if (_session) { + e = _session->current_end_frame (); + } + e += current_page_frames () / 10; + horizontal_adjustment.set_upper (e / frames_per_unit); horizontal_adjustment.set_value (pending_visual_change.time_origin / frames_per_unit); } if (p & VisualChange::YOrigin) { vertical_adjustment.set_value (pending_visual_change.y_origin); } - nframes64_t csf=0, cef=0; - nframes64_t current_time_origin = (nframes64_t) floor (horizontal_adjustment.get_value() * frames_per_unit); - - if (_session) { - csf = _session->current_start_frame(); - cef = _session->current_end_frame(); - } - - /* if we seek beyond the current end of the canvas, move the end */ - - - if (last_time_origin == horizontal_adjustment.get_value() ) { + if (last_time_origin == horizontal_adjustment.get_value()) { /* changed signal not emitted */ update_fixed_rulers (); redisplay_tempo (true); } - if (current_time_origin != pending_visual_change.time_origin) { - cef += current_page_frames() / 10; // Add a little extra so we can see the end marker - horizontal_adjustment.set_upper (cef / frames_per_unit); - horizontal_adjustment.set_value (pending_visual_change.time_origin / frames_per_unit); - } else { - update_fixed_rulers(); - redisplay_tempo (true); - } - _summary->set_overlays_dirty (); // cerr << "Editor::idle_visual_changer () called ha v:l:u:ps:fpu = " << horizontal_adjustment.get_value() << ":" << horizontal_adjustment.get_lower() << ":" << horizontal_adjustment.get_upper() << ":" << horizontal_adjustment.get_page_size() << ":" << frames_per_unit << endl;//DEBUG @@ -4753,7 +4740,7 @@ Editor::idle_resize () void Editor::located () { - ENSURE_GUI_THREAD (*this, &Editor::located) + ENSURE_GUI_THREAD (*this, &Editor::located); _pending_locate_request = false; } |