13
0

Fix ruler scale on initial view (apply patch from nick_m).

git-svn-id: svn://localhost/ardour2/branches/3.0@3101 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2008-02-21 19:51:41 +00:00
parent 4afabf43e5
commit 4b5ee47d44
3 changed files with 10 additions and 10 deletions

View File

@ -2199,7 +2199,7 @@ Editor::set_snap_to (SnapType st)
case SnapToAEighthBeat:
case SnapToAQuarterBeat:
case SnapToAThirdBeat:
compute_bbt_ruler_scale (leftmost_frame, leftmost_frame + (nframes_t)(canvas_width * frames_per_unit));
compute_bbt_ruler_scale (leftmost_frame, leftmost_frame + (nframes_t)(edit_packer.get_width() * frames_per_unit));
update_tempo_based_rulers ();
break;
@ -4404,8 +4404,8 @@ Editor::idle_visual_changer ()
set_frames_per_unit (pending_visual_change.frames_per_unit);
compute_fixed_ruler_scale ();
compute_current_bbt_points(pending_visual_change.time_origin, pending_visual_change.time_origin + (nframes_t)(canvas_width * pending_visual_change.frames_per_unit));
compute_bbt_ruler_scale (pending_visual_change.time_origin, pending_visual_change.time_origin + (nframes_t)(canvas_width * pending_visual_change.frames_per_unit));
compute_current_bbt_points(pending_visual_change.time_origin, pending_visual_change.time_origin + (nframes_t)(edit_packer.get_width() * pending_visual_change.frames_per_unit));
compute_bbt_ruler_scale (pending_visual_change.time_origin, pending_visual_change.time_origin + (nframes_t)(edit_packer.get_width() * pending_visual_change.frames_per_unit));
update_tempo_based_rulers ();
}
if (p & VisualChange::TimeOrigin) {

View File

@ -802,8 +802,8 @@ Editor::update_ruler_visibility ()
time_canvas_event_box.show_all();
time_button_frame.show_all();
compute_current_bbt_points (leftmost_frame, leftmost_frame + (nframes_t)(canvas_width * frames_per_unit));
compute_bbt_ruler_scale (leftmost_frame, leftmost_frame + (nframes_t)(canvas_width * frames_per_unit));
compute_current_bbt_points (leftmost_frame, leftmost_frame + (nframes_t)(edit_packer.get_width() * frames_per_unit));
compute_bbt_ruler_scale (leftmost_frame, leftmost_frame + (nframes_t)(edit_packer.get_width() * frames_per_unit));
redisplay_tempo (false);
}
@ -833,11 +833,11 @@ Editor::compute_fixed_ruler_scale ()
}
if (ruler_shown[ruler_metric_smpte]) {
set_smpte_ruler_scale (leftmost_frame, leftmost_frame + (canvas_width * frames_per_unit) );
set_smpte_ruler_scale (leftmost_frame, leftmost_frame + (edit_packer.get_width() * frames_per_unit) );
}
if (ruler_shown[ruler_metric_minsec]) {
set_minsec_ruler_scale (leftmost_frame, leftmost_frame + (canvas_width * frames_per_unit) );
set_minsec_ruler_scale (leftmost_frame, leftmost_frame + (edit_packer.get_width() * frames_per_unit) );
}
}

View File

@ -99,9 +99,9 @@ Editor::tempo_map_changed (Change ignored)
return;
}
ENSURE_GUI_THREAD(bind (mem_fun (*this, &Editor::tempo_map_changed), ignored));
ENSURE_GUI_THREAD(bind (mem_fun (*this, &Editor::tempo_map_changed), ignored));
compute_current_bbt_points(leftmost_frame, leftmost_frame + (nframes_t)(canvas_width * frames_per_unit));
compute_current_bbt_points(leftmost_frame, leftmost_frame + (nframes_t)(edit_packer.get_width() * frames_per_unit));
session->tempo_map().apply_with_metrics (*this, &Editor::draw_metric_marks); // redraw metric markers
update_tempo_based_rulers ();
if (tempo_map_change_idle_handler_id < 0) {
@ -116,7 +116,7 @@ Editor::redisplay_tempo (bool immediate_redraw)
return;
}
compute_current_bbt_points (leftmost_frame, leftmost_frame + (nframes_t)(canvas_width * frames_per_unit)); // redraw rulers and measures
compute_current_bbt_points (leftmost_frame, leftmost_frame + (nframes_t)(edit_packer.get_width() * frames_per_unit)); // redraw rulers and measures
if (immediate_redraw) {