Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #24896: Lyrics getting stuck on odd/even styles #24935

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading