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 system-text line visible when all staves hidden and code improvement #26343

Conversation

mike-spa
Copy link
Contributor

@mike-spa mike-spa commented Feb 5, 2025

Resolves: #25123

The fix in itself was one LOC, but as I looked into it I realized that this function was unnecessarily complex and expensive. Even though for the vast majority of items (which are not system-objects) the function exits at the first check, this is a function that gets called at every frame refresh for every item on screen, so it's still important to avoid stuff like

  • calls to Score::tick2measure()
  • unnecessary (and I guess unintentional) copies of Score::systemObjectStaves
  • unnecessary nested loops.

The name was also misleading, so I've changed it to effectiveStaffIdx.

@mike-spa mike-spa requested a review from oktophonie February 5, 2025 09:41
@Jojo-Schmitz
Copy link
Contributor

Out of curiosity, what would that one LOC fix have been?

@oktophonie oktophonie requested a review from miiizen February 5, 2025 13:17
@RomanPudashkin RomanPudashkin merged commit fbf69d9 into musescore:master Feb 5, 2025
11 checks passed
@mike-spa mike-spa deleted the fixSystemLinesVisibleWithNoStavesAndMMrests branch February 17, 2025 10:27
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.

Multi-bar tempo change lines persist in parts even when there are no instruments
4 participants