Skip to content

Commit

Permalink
Fix wrong tuplet position with local time sig
Browse files Browse the repository at this point in the history
Resolves: musescore#25110

Backport of musescore#26100, commit 5 plus some more
  • Loading branch information
mike-spa authored and Jojo-Schmitz committed Feb 7, 2025
1 parent fc8d7c2 commit 8cae6a8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions libmscore/layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4555,11 +4555,16 @@ void Score::layoutSystemElements(System* system, LayoutContext& lc)
// layout tuplets
//-------------------------------------------------------------

std::map<int, Fraction> skipTo;
for (Segment* s : sl) {
for (Element* e : s->elist()) {
if (!e || !e->isChordRest() || !score()->staff(e->staffIdx())->show())
continue;
int track = e->track();
if (skipTo.count(track) && e->tick() < skipTo[track])
continue; // don't lay out tuplets for this voice that have already been done
ChordRest* cr = toChordRest(e);
#if 0
if (!isTopTuplet(cr))
continue;
DurationElement* de = cr;
Expand All @@ -4568,6 +4573,19 @@ void Score::layoutSystemElements(System* system, LayoutContext& lc)
t->layout();
de = t;
}
#else
// find the top tuplet for this segment
DurationElement* de = cr;
if (!de->tuplet())
continue;
while (de->tuplet())
de = de->tuplet();
de->layout();
#endif

// don't layout any tuplets covered by this top level tuplet for this voice--
// they've already been laid out by Tuplet::layout().
skipTo[track] = de->tick() + de->actualTicks();
}
}

Expand Down

0 comments on commit 8cae6a8

Please sign in to comment.