summaryrefslogtreecommitdiff
path: root/libs/ardour/region.cc
diff options
context:
space:
mode:
authornick_m <mainsbridge@gmail.com>2016-06-11 05:40:50 +1000
committernick_m <mainsbridge@gmail.com>2016-06-11 05:40:50 +1000
commitf3b4644969c4a40c1afdd4aa2e77ce8b8b25a3f9 (patch)
tree792d2dea0871d9066b4041ce9ed6a8944386d4f2 /libs/ardour/region.cc
parent8ceab4e193bb451607b68bdf892b79893b399d1a (diff)
Fix many offset errors when drawing notes in midi regions that have been edited.
- hopefully this can close bugs such as 6270 & 6793
Diffstat (limited to 'libs/ardour/region.cc')
-rw-r--r--libs/ardour/region.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc
index 15a3da8b8b..9119659870 100644
--- a/libs/ardour/region.cc
+++ b/libs/ardour/region.cc
@@ -441,7 +441,6 @@ Region::set_length (framecnt_t len)
}
- _last_length = _length;
set_length_internal (len);
_whole_file = false;
first_edit ();
@@ -459,6 +458,7 @@ Region::set_length (framecnt_t len)
void
Region::set_length_internal (framecnt_t len)
{
+ _last_length = _length;
_length = len;
}
@@ -925,6 +925,12 @@ Region::trim_to_internal (framepos_t position, framecnt_t length)
PropertyChange what_changed;
+ if (_start != new_start) {
+ set_start_internal (new_start);
+ what_changed.add (Properties::start);
+ }
+
+
/* Set position before length, otherwise for MIDI regions this bad thing happens:
* 1. we call set_length_internal; length in beats is computed using the region's current
* (soon-to-be old) position
@@ -941,11 +947,6 @@ Region::trim_to_internal (framepos_t position, framecnt_t length)
what_changed.add (Properties::position);
}
- if (_start != new_start) {
- set_start_internal (new_start);
- what_changed.add (Properties::start);
- }
-
if (_length != length) {
if (!property_changes_suspended()) {
_last_length = _length;
@@ -1834,4 +1835,3 @@ Region::latest_possible_frame () const
return _position + (minlen - _start) - 1;
}
-