Skip to content

Commit

Permalink
fix #63041: editing spanner length with tuplets
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella committed Aug 15, 2015
1 parent 4ea940f commit ed6aa2e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion libmscore/score.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3612,7 +3612,10 @@ ChordRest* Score::findCRinStaff(int tick, int staffIdx) const
ChordRest* cr = static_cast<ChordRest*>(ns->element(t));
if (cr) {
int endTick = cr->tick() + cr->actualTicks();
if (endTick >= lastTick && endTick <= tick) {
// allow fudge factor for tuplets
// TODO: replace with fraction-based calculation
int fudge = cr->tuplet() ? 5 : 0;
if (endTick + fudge >= lastTick && endTick - fudge <= tick) {
s = ns;
actualTrack = t;
lastTick = endTick;
Expand Down
5 changes: 4 additions & 1 deletion libmscore/spanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,10 @@ void Spanner::computeEndElement()
if (!endCR()->measure()->isMMRest()) {
ChordRest* cr = endCR();
int nticks = cr->tick() + cr->actualTicks() - _tick;
if (_ticks != nticks) {
// allow fudge factor for tuplets
// TODO: replace with fraction-based calculation
int fudge = cr->tuplet() ? 5 : 0;
if (qAbs(_ticks - nticks) > fudge) {
qDebug("%s ticks changed, %d -> %d", name(), _ticks, nticks);
setTicks(nticks);
if (type() == Element::Type::OTTAVA)
Expand Down

0 comments on commit ed6aa2e

Please sign in to comment.