Skip to content

Commit

Permalink
Fix lyrics getting stuck on odd/even styles
Browse files Browse the repository at this point in the history
  • Loading branch information
mathesoncalum committed Sep 26, 2024
1 parent b64712c commit 7485d7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
14 changes: 0 additions & 14 deletions src/engraving/rendering/score/lyricslayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,6 @@ void LyricsLayout::layout(Lyrics* item, LayoutContext& ctx)
}
}

bool styleDidChange = false;
if (item->isEven() && (item->textStyleType() != TextStyleType::LYRICS_EVEN)) {
item->initTextStyleType(TextStyleType::LYRICS_EVEN, /* preserveDifferent */ true);
styleDidChange = true;
}
if (!item->isEven() && (item->textStyleType() != TextStyleType::LYRICS_ODD)) {
item->initTextStyleType(TextStyleType::LYRICS_ODD, /* preserveDifferent */ true);
styleDidChange = true;
}

if (styleDidChange) {
item->styleChanged();
}

createOrRemoveLyricsLine(item, ctx);

if (item->isMelisma() || hasNumber) {
Expand Down
12 changes: 3 additions & 9 deletions src/notation/internal/notationinteraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4966,6 +4966,7 @@ void NotationInteraction::navigateToLyrics(bool back, bool moveOnly, bool end)
mu::engraving::PropertyFlags pFlags = lyrics->propertyFlags(mu::engraving::Pid::PLACEMENT);
mu::engraving::FontStyle fStyle = lyrics->fontStyle();
mu::engraving::PropertyFlags fFlags = lyrics->propertyFlags(mu::engraving::Pid::FONT_STYLE);
mu::engraving::TextStyleType styleType = lyrics->textStyleType();

mu::engraving::Segment* nextSegment = segment;
if (back) {
Expand Down Expand Up @@ -5020,11 +5021,8 @@ void NotationInteraction::navigateToLyrics(bool back, bool moveOnly, bool end)
nextLyrics->setTrack(track);
cr = toChordRest(nextSegment->element(track));
nextLyrics->setParent(cr);

nextLyrics->setNo(verse);
const mu::engraving::TextStyleType styleType(nextLyrics->isEven() ? TextStyleType::LYRICS_EVEN : TextStyleType::LYRICS_ODD);
nextLyrics->setTextStyleType(styleType);

nextLyrics->setPlacement(placement);
nextLyrics->setPropertyFlags(mu::engraving::Pid::PLACEMENT, pFlags);
nextLyrics->setSyllabic(mu::engraving::LyricsSyllabic::SINGLE);
Expand Down Expand Up @@ -5108,6 +5106,7 @@ void NotationInteraction::navigateToNextSyllable()
mu::engraving::PropertyFlags pFlags = lyrics->propertyFlags(mu::engraving::Pid::PLACEMENT);
mu::engraving::FontStyle fStyle = lyrics->fontStyle();
mu::engraving::PropertyFlags fFlags = lyrics->propertyFlags(mu::engraving::Pid::FONT_STYLE);
mu::engraving::TextStyleType styleType = lyrics->textStyleType();

// search next chord
mu::engraving::Segment* nextSegment = segment;
Expand Down Expand Up @@ -5181,11 +5180,8 @@ void NotationInteraction::navigateToNextSyllable()
toLyrics = Factory::createLyrics(cr);
toLyrics->setTrack(track);
toLyrics->setParent(cr);

toLyrics->setNo(verse);
const mu::engraving::TextStyleType styleType(toLyrics->isEven() ? TextStyleType::LYRICS_EVEN : TextStyleType::LYRICS_ODD);
toLyrics->setTextStyleType(styleType);

toLyrics->setPlacement(placement);
toLyrics->setPropertyFlags(mu::engraving::Pid::PLACEMENT, pFlags);
toLyrics->setSyllabic(mu::engraving::LyricsSyllabic::END);
Expand Down Expand Up @@ -5760,6 +5756,7 @@ void NotationInteraction::addMelisma()
mu::engraving::PropertyFlags pFlags = lyrics->propertyFlags(mu::engraving::Pid::PLACEMENT);
mu::engraving::FontStyle fStyle = lyrics->fontStyle();
mu::engraving::PropertyFlags fFlags = lyrics->propertyFlags(mu::engraving::Pid::FONT_STYLE);
mu::engraving::TextStyleType styleType = lyrics->textStyleType();
Fraction endTick = segment->tick(); // a previous melisma cannot extend beyond this point

endEditText();
Expand Down Expand Up @@ -5836,11 +5833,8 @@ void NotationInteraction::addMelisma()
toLyrics = Factory::createLyrics(cr);
toLyrics->setTrack(track);
toLyrics->setParent(cr);

toLyrics->setNo(verse);
const mu::engraving::TextStyleType styleType(toLyrics->isEven() ? TextStyleType::LYRICS_EVEN : TextStyleType::LYRICS_ODD);
toLyrics->setTextStyleType(styleType);

toLyrics->setPlacement(placement);
toLyrics->setPropertyFlags(mu::engraving::Pid::PLACEMENT, pFlags);
toLyrics->setSyllabic(mu::engraving::LyricsSyllabic::SINGLE);
Expand Down

0 comments on commit 7485d7a

Please sign in to comment.