Skip to content

Commit

Permalink
Correct dynamic end-of-duration alignment in case of clefs
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-spa committed Dec 23, 2024
1 parent 4648888 commit 872daea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/engraving/rendering/score/measurelayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2217,6 +2217,18 @@ void MeasureLayout::layoutTimeTickAnchors(Measure* m, LayoutContext& ctx)
Fraction relativeTick = segment.rtick() - refCRSeg->rtick();

Segment* nextCRSeg = m->findSegmentR(SegmentType::ChordRest, refCRSeg->rtick() + refCRSeg->ticks());
if (!nextCRSeg) {
Fraction refEndTick = refCRSeg->tick() + refSegDuration;
nextCRSeg = refCRSeg;
while (nextCRSeg) {
Segment* next = nextCRSeg->next();
if (next && next->tick() <= refEndTick) {
nextCRSeg = next;
} else {
break;
}
}
}
double width = nextCRSeg ? nextCRSeg->x() - refCRSeg->x() : refCRSeg->width();

double relativeX = width * (relativeTick.toDouble() / refCRSeg->ticks().toDouble());
Expand Down
Binary file added vtest/scores/dynamics-11.mscz
Binary file not shown.

0 comments on commit 872daea

Please sign in to comment.