From 1fdfa53b9f769aebb11b1b503843bdb638121fa8 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Thu, 12 May 2022 11:56:32 -0500 Subject: [PATCH] region::absolute_time_to_region_beats() needs to incorporate start offset * this fixes the Draw tool when adding notes; if you tried to draw in a region with a trimmed front, the note would not get added in the correct location --- libs/ardour/ardour/region.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index dbc6acbb7d..04da097d22 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -303,7 +303,7 @@ public: Temporal::Beats absolute_time_to_source_beats(Temporal::timepos_t const &) const; Temporal::Beats absolute_time_to_region_beats (Temporal::timepos_t const & b) const { - return position().distance (b).beats (); + return position().distance (b+start()).beats (); } int apply (Filter &, Progress* progress = 0);