From 0015cc8c689a97e56c693a94402e423640ba8b6e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 26 Jan 2025 15:50:42 -0700 Subject: [PATCH] move zoom scaling out of ::zoom_to_show() and into the caller --- gtk2_ardour/pianoroll.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/pianoroll.cc b/gtk2_ardour/pianoroll.cc index 5a74278e5e..33a3f3c7c5 100644 --- a/gtk2_ardour/pianoroll.cc +++ b/gtk2_ardour/pianoroll.cc @@ -1998,7 +1998,7 @@ Pianoroll::set_region (std::shared_ptr r) { EditingContext::TempoMapScope tms (*this, map); /* Compute zoom level to show entire source plus some margin if possible */ - zoom_to_show (timecnt_t (timepos_t (max_zoom_extent ().second.beats()))); + zoom_to_show (timecnt_t (timepos_t (max_extents_scale() * max_zoom_extent ().second.samples()))); } @@ -2013,9 +2013,9 @@ Pianoroll::zoom_to_show (Temporal::timecnt_t const & duration) } /* make it 20% wider than we need */ - samplecnt_t samples = (samplecnt_t) floor (max_extents_scale() * duration.samples()); - samplecnt_t spp = floor (samples / _visible_canvas_width); + samplecnt_t samples = duration.samples(); samplecnt_t spp = floor (samples / _track_canvas_width); + reset_zoom (spp); }