Skip to content

Commit

Permalink
Exception to "Omit dash"
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-spa committed May 14, 2024
1 parent 2c7d509 commit b5fbd42
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/engraving/rendering/dev/lyricslayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,16 +357,18 @@ void LyricsLayout::layoutDashes(LyricsLineSegment* item)
item->setPos(startX, y);
item->setPos2(PointF(endX - startX, 0.0));

bool isDashOnFirstSyllable = lyricsLine->tick2() == system->firstMeasure()->tick();
double curLength = endX - startX;
double dashMinLength = style.styleMM(Sid::lyricsDashMinLength);
int dashCount = std::floor(curLength / style.styleMM(Sid::lyricsDashMaxDistance));
if (curLength > dashMinLength || style.styleB(Sid::lyricsDashForce)) {
bool forceDash = style.styleB(Sid::lyricsDashForce)
|| (style.styleB(Sid::lyricsShowDashIfSyllableOnFirstNote) && isDashOnFirstSyllable);
if (curLength > dashMinLength || forceDash) {
dashCount = std::max(dashCount, 1);
}

if (curLength < dashMinLength && dashCount > 0) {
double diff = dashMinLength - curLength;
bool isDashOnFirstSyllable = lyricsLine->tick2() == system->firstMeasure()->tick();
if (isDashOnFirstSyllable) {
startX -= diff;
} else {
Expand Down

0 comments on commit b5fbd42

Please sign in to comment.