From dc9484d1449d04923849316a3ac7c74c4c49ec23 Mon Sep 17 00:00:00 2001 From: Nick Mainsbridge Date: Sun, 10 Sep 2006 17:49:03 +0000 Subject: more fiddling about with placing bits of the scroll/zoom operation in the idle callback. fix some ruler bugs. overall this should be smoother. git-svn-id: svn://localhost/ardour2/trunk@912 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_canvas.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'gtk2_ardour/editor_canvas.cc') diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index 946df13334..0c3436ec40 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -266,8 +266,10 @@ Editor::initialize_canvas () edit_cursor = new Cursor (*this, "blue", &Editor::canvas_edit_cursor_event); playhead_cursor = new Cursor (*this, "red", &Editor::canvas_playhead_cursor_event); - + + initial_ruler_update_required = true; track_canvas.signal_size_allocate().connect (mem_fun(*this, &Editor::track_canvas_allocate)); + } void @@ -317,10 +319,15 @@ Editor::track_canvas_allocate (Gtk::Allocation alloc) transport_punchout_line->property_y2() = canvas_height; } - update_fixed_rulers (); - - if (is_visible()) { + if (is_visible() && initial_ruler_update_required) { + /* + this is really dumb, but signal_size_allocate() gets emitted intermittently + depending on whether the canvas contents are visible or not. + we only want to do this once + */ + update_fixed_rulers(); tempo_map_changed (Change (0)); + initial_ruler_update_required = false; } Resized (); /* EMIT_SIGNAL */ -- cgit v1.2.3