From 97109672c784f9b78617ed9bef72c046a55aa25c Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 18 May 2014 12:22:23 -0400 Subject: initial redesign of canvas scrolling to facilitate independent x- and y-axis scrolling of specific groups within the canvas. This commit should cause no change in behaviour, but contains all the code and changes necessary for the next step --- gtk2_ardour/editor_markers.cc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'gtk2_ardour/editor_markers.cc') diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 3cf3ef83b7..371feaff58 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -1465,16 +1465,23 @@ Editor::update_punch_range_view () Location* tpl; if ((_session->config.get_punch_in() || _session->config.get_punch_out()) && ((tpl = transport_punch_location()) != 0)) { - ArdourCanvas::Rect const v = _track_canvas->visible_area (); + double pixel_start; + double pixel_end; + if (_session->config.get_punch_in()) { - transport_punch_range_rect->set_x0 (sample_to_pixel (tpl->start())); - transport_punch_range_rect->set_x1 (_session->config.get_punch_out() ? sample_to_pixel (tpl->end()) : sample_to_pixel (max_framepos)); + pixel_start = sample_to_pixel (tpl->start()); + } else { + pixel_start = 0; + } + if (_session->config.get_punch_out()) { + pixel_end = sample_to_pixel (tpl->end()); } else { - transport_punch_range_rect->set_x0 (0); - transport_punch_range_rect->set_x1 (_session->config.get_punch_out() ? sample_to_pixel (tpl->end()) : v.width ()); + pixel_end = sample_to_pixel (max_framepos); } + transport_punch_range_rect->set_x0 (pixel_start); + transport_punch_range_rect->set_x1 (pixel_end); transport_punch_range_rect->show(); } else { -- cgit v1.2.3