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

Fixes to system text and system text lines (#22811) #22866

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mathesoncalum
Copy link
Contributor

Resolves: #22811

While working on this issue I noticed that system text lines added to list selections and system text lines added to range selections had different font sizes. This is because, in the range case, the spanner was being initialised without the "system flag" and was being treated as a regular text line. This PR ensures that we use identical initialisations in both cases.

Additionally, the decision was made to change our default systemTextFontSize to 12pt, bringing it in-line with systemTextLineFontSize. Whether these should be different styles at all is a question for another day (somewhat related to #14238).

spanner->styleChanged();
score->cmdAddSpanner(spanner, i, startSegment, endSegment, modifiers & Qt::ControlModifier);
mu::engraving::Spanner* s = static_cast<mu::engraving::Spanner*>(engraving::Factory::createItem(type, score->dummy()));
rw::RWRegister::reader()->readItem(s, e);
Copy link
Contributor

Choose a reason for hiding this comment

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

Except for consistency, does this change have a specific effect? If not, I'm not sure how nice this is, because going via mime data is definitely less efficient than just cloning directly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Partly consistency, partly the fact that cloning doesn't seem to produce a text line with "system" style (e.g. font size). Unsure why this is the case, I'll look into it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright @cbjeukendrup - just pushed a different approach using clones & fixed the unit tests.

@mathesoncalum mathesoncalum force-pushed the 22811-system_text_staff branch 3 times, most recently from e8436cf to b9200da Compare May 28, 2024 08:57
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.

System line is added to wrong staff when single note/rest is selected
2 participants