summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_markers.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-05-18 12:22:23 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-06-03 16:09:06 -0400
commit97109672c784f9b78617ed9bef72c046a55aa25c (patch)
treef41be112c548a60e0e9a3fc4f903633dae0c5882 /gtk2_ardour/editor_markers.cc
parentee6c483d18790a5447b95c7c71ab410d0d778132 (diff)
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
Diffstat (limited to 'gtk2_ardour/editor_markers.cc')
-rw-r--r--gtk2_ardour/editor_markers.cc17
1 files changed, 12 insertions, 5 deletions
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 {