diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index b2f84fe638..799d441b16 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -2800,7 +2800,7 @@ TrimDrag::motion (GdkEvent* event, bool first_move) if (arv) { boost::shared_ptr ar (arv->audio_region()); framecnt_t len = ar->fade_out()->back()->when; - framecnt_t diff = ar->last_frame() - i->initial_end; + framecnt_t diff = 1 + ar->last_frame() - i->initial_end; framepos_t new_length = len + diff; i->anchored_fade_length = min (ar->length(), new_length); //i->anchored_fade_length = ar->verify_xfade_bounds (new_length, false /*END*/ ); diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index 071cae9127..54cfd57fea 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -139,7 +139,7 @@ class LIBARDOUR_API Region /* first_frame() is an alias; last_frame() just hides some math */ framepos_t first_frame () const { return _position; } - framepos_t last_frame () const { return _position + _length; } + framepos_t last_frame () const { return _position + _length - 1; } /** Return the earliest possible value of _position given the * value of _start within the region's sources @@ -151,7 +151,7 @@ class LIBARDOUR_API Region framepos_t latest_possible_frame () const; Evoral::Range last_range () const { - return Evoral::Range (_last_position, _last_position + _last_length); + return Evoral::Range (_last_position, _last_position + _last_length - 1); } Evoral::Range range () const {