-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 #277565: Shortening notes too much leads to bad stem layout #4086
Conversation
7589cc3
to
c98cee5
Compare
c98cee5
to
c56d09d
Compare
Yes, my patch addresses that as well. It is what I meant when I was talking about stems outside the staff being shortened so much that the stem overshoots the notehead. I believe I described my patch as handling any number of hooks. |
libmscore/chord.cpp
Outdated
@@ -1214,8 +1255,8 @@ qreal Chord::defaultStemLength() | |||
const Staff* st = staff(); | |||
qreal lineDistance = st ? st->lineDistance(tick()) : 1.0; | |||
|
|||
const StaffType* tab = st ? st->staffType(tick()) : 0; | |||
if (tab && tab->isTabStaff()) { | |||
const StaffType* tab = (st && st->isTabStaff(tick())) ? st->staffType(tick()) : 0; |
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.
nullptr
instead of 0
?
|
||
qreal normalStemLen = small() ? 2.5 : 3.5; | ||
switch (hookIdx) { | ||
case 3: normalStemLen += small() ? .5 : 0.75; break; //32nd notes |
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.
We lost the comments describing magic numbers. Could you please add more info in the comments to hookAdjustment()
method to describe magic numbers and calculations in general?
@mattmcclinch cool thanks! Maybe also related? Downwards stems without hooks are sometimes very short on note groups. This is very apparent on this screencap for two reasons:
|
I am not a fan of stem shortening to begin with, but since Elaine Gould writes about it in Behind Bars (pg. 14) we have it in MuseScore. But it is a style setting that can be adjusted somewhat or even turned off completely on a per-score basis. Stems will not be shortened if the chord has a beam, which is why the beamed chords have longer stems than the non-beamed chords. Stem shortening only affects stems outside the staff, which is why the downstem chords in the picture have shorter stems than the upstem chords. |
@mattmcclinch Thanks for the explanation! I don't like it either, so I'll make it more subte or maybe turn it off. |
c56d09d
to
992f322
Compare
It could be worth adding a couple of vtests for this one and make sure it works for all supported fonts. |
I will add the tests. |
See https://musescore.org/en/node/277565.
Currently, the stem is only lengthened for 3, 4, or 5 hooks. This patch allows the stem to be lengthened for any number of hooks.
This patch also fixes the glyphs for 128th note flags in the mscore font so that they will align properly with the stem.
A few explanations about these changes: