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 #24742: Lost cursor style when moving to next syllable, verse, etc. #24792

Merged

Conversation

mathesoncalum
Copy link
Contributor

@mathesoncalum mathesoncalum commented Sep 18, 2024

Resolves: #24742

The underlying problem here is that we're calling TextCursor::set when we really shouldn't. This method is used to set the cursor based on a point (set by the mouse) which we don't have when we're adding lyrics with the keyboard. This initially became a problem with #22209 (after this we call updateCursorFormat every time set is called), and the problem evolved with #23627 (changes to font metrics caused an early return inside set, leading to a resetFormatting call).

The first part of this fix is a change to bindCursorPosToText as this was spitting out garbage values when cursorPos was null. After this we can check whether startMove is null and avoid unwanted calls to TextCursor::set.

After making these changes everything is fine for syllables, melisma, etc. - but I discovered that verses were still broken. This is for an entirely different reason - these were broken in #23868 when some setIsEven calls were removed. The problem here is that styleDidChange will evaluate to true in LyricsLayout::layout due to a mismatch between isEven and the TextStyleType.

Copy link
Contributor

@mike-spa mike-spa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

@zacjansheski
Copy link
Contributor

Tested on MacOS 14, Windows 11, Ubuntu 22.04.3. Approved
#24742 FIXED

@RomanPudashkin RomanPudashkin merged commit 65ac7a5 into musescore:master Sep 18, 2024
11 checks passed
@mathesoncalum mathesoncalum deleted the 24742-lost_cursor_style branch September 18, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lyrics styles don't stick when moving to the next syllable again
5 participants