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 #21131: bad ledger line size with small notes #5140

Merged
merged 1 commit into from
Jun 20, 2019

Conversation

MarcSabatella
Copy link
Contributor

See https://musescore.org/en/node/21131.

It's a very old issue. The original report about thickness of ledger lines on cue notes is actually not applicable - setting the chord small as opposed to the note accomplishes that goal. But later the thread turned to the question of the length of the ledger lines in the case of chords with mixed note sizes, and we definitely don't do well. This PR implements what seems the most sensible approach (supported by the examples shown): ledger lines are wide enough to support any note on that line as well as any note further from the staff. See in particular https://musescore.org/en/node/21131#comment-928142

@MarcSabatella
Copy link
Contributor Author

Bonus: apparently this also fixes https://musescore.org/en/node/22882

@@ -732,6 +733,7 @@ void Chord::addLedgerLines()

if (note->visible()) // if one note is visible,
visible = true; // all lines between it and the staff are visible
hw = qMax(hw, note->headWidth());
Copy link
Contributor

Choose a reason for hiding this comment

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

But hw is used in the same loop (see line 760/762 below), couldn't that cause any issues? Maybe it would be more reliable to find a maximal notehead width before executing this loop.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or is the intention to keep the ledger line small for small notes that lay further from a staff?

Copy link
Contributor Author

@MarcSabatella MarcSabatella Jun 20, 2019

Choose a reason for hiding this comment

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

Exactly - after reading through the different comments and looking at the different example, this seemed the most desirable solution. So, if the outmost notes in a chord are small, they get small ledger lines. As soon as a full-size note is encountered, the rest of the ledger lines from there to the staff are full-size as well.

It's not obvious unless you look closely, but check out the first and third chords in the image I showed in the issue thread:

ledger-line-size

First shows only the outermost ledger lines small, then full-size. Third shows them all small, because no full-size notes needed them.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, looks reasonable indeed, thanks!

@dmitrio95 dmitrio95 merged commit 50e4e7d into musescore:master Jun 20, 2019
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.

2 participants