Skip to content

Commit

Permalink
Calculate width from position for clef, key&time sigs
Browse files Browse the repository at this point in the history
  • Loading branch information
miiizen committed Feb 28, 2025
1 parent 40abdaa commit 37ffb28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/engraving/rendering/score/horizontalspacing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,12 @@ void HorizontalSpacing::setPositionsAndWidths(const std::vector<SegmentPosition>
Measure* curSegMeasure = curSeg->measure();
Measure* nextSegMeasure = nextSeg->measure();

double segWidth = curSegMeasure == nextSegMeasure || nextSeg->isStartRepeatBarLineType() ? nextX - curX : curSeg->minRight();
bool leadingNonCRException = ((nextSeg->isKeySigType() || nextSeg->isTimeSigType()
|| nextSeg->isClefType()) && !curSeg->isType(SegmentType::BarLineType));
bool computeWidthByDifferenceFromNext = curSegMeasure == nextSegMeasure || nextSeg->isStartRepeatBarLineType()
|| leadingNonCRException;

double segWidth = computeWidthByDifferenceFromNext ? nextX - curX : curSeg->minRight();

curSeg->setWidth(segWidth);

Expand Down
Binary file added vtest/scores/leadingNonChordSeg.mscz
Binary file not shown.

0 comments on commit 37ffb28

Please sign in to comment.