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
This commit is contained in:
Ben Loftis 2022-05-12 11:56:32 -05:00
parent 78f1205806
commit 1fdfa53b9f
1 changed files with 1 additions and 1 deletions

View File

@ -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);