fix Beats::operator-()

This commit is contained in:
Paul Davis 2020-04-16 21:38:33 -06:00
parent e4e035c6e2
commit 70e27e0bf2

View File

@ -228,7 +228,14 @@ public:
}
Beats operator-() const {
return Beats(-_beats, -_ticks);
/* must avoid normalization here, which will convert a negative
value into a valid beat position before zero, which is not
we want here.
*/
Beats b (_beats, _ticks);
b._beats = -b._beats;
b._ticks = -b._ticks;
return b;
}
template<typename Number>