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 #15407: Hide zero-length lyrics dashes #15459
Fix #15407: Hide zero-length lyrics dashes #15459
Conversation
This one ended up being a little more in-depth than I expected it to be.
|
c43e5aa
to
f11e1d2
Compare
5fb0a5f
to
28317e3
Compare
28317e3
to
590e6b3
Compare
src/engraving/libmscore/lyrics.cpp
Outdated
// - currently used to determine the first lyric of a melisma | ||
//--------------------------------------------------------- | ||
|
||
Lyrics* Lyrics::prevLyrics() const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest moving it into navigate.h/cpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid I don't understand this one. You want the lyrics class to be in navigate.h?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, only this function :)
2ba7519
to
f1f1f8d
Compare
1715bc8
to
d881c91
Compare
Issue #15093 was extremely similar, so I just added it to this PR since it deals with the same behavior. If the ticks for a lyric become zero for any reason now (not just when editing a lyric finishes), the lyric re-lays-out to make sure invalid segments don't remain. |
27f99a6
to
6021b7d
Compare
src/engraving/libmscore/navigate.cpp
Outdated
// - currently used to determine the first lyric of a melisma | ||
//--------------------------------------------------------- | ||
|
||
Lyrics* Lyrics::prevLyrics() const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not exactly what I meant :) You should declare a function in navigate.h (similar to prevChordRest):
extern Lyrics* prevLyrics(const Lyrics* lyrics);
Then use this new function in TextBase::endEdit(EditData& ed):
if (isLyrics()) {
Lyrics* prevLyrics = prevLyrics(toLyrics(this));
if (prevLyrics) {
...
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record, why do we want to do this? Is there a reason prevLyrics shouldn't be a method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it can iterate implicitly over the whole score. And in general, has low cohesion in this class (it does not depend on anything within this class, and can easily be moved out of it and take it as an argument). We want engraving elements to be as simple as possible
(after end editing)
if ticks become zero we have to make sure we remove invalid segments
6021b7d
to
9ad1b95
Compare
Resolves: #15407
Resolves: #15093
See comment, the solution for this one has changed.