-
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
Hide extra dots when toggling rhythmic slashes #20175
Conversation
2f07ebe
to
049ac6f
Compare
if (item->fixed() && !item->visible()) { | ||
item->setDotsHidden(true); |
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.
Could you tell a bit more about what this does and why the logic for it is exactly "item->fixed() && !item->visible()"? (Just because I'm interested 😊)
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.
So item->fixed()
is only true when rhythmic slashes are toggled. Notes of chords are all placed on the same line, and all but one note made invisible. However, even though the dots aren't visible, they show up grayed out. They also get laid out properly, which we would usually want to do, but for this specific circumstance we want to hide the invisible dots behind the visible one. setDotsHidden
prevents the dots being moved to avoid colliding with each other.
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.
I believe that item->fixed()
was not originally related to rhythmic slashes; in MuseScore 3, there was also a UI to set this property manually for other notes. In MuseScore 4, the UI for this was simply removed.
Anyway, I guess there is not really a better way to detect rhythmic slashes... at least not until we give Chords a dedicated property for that.
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.
For the recording, the "fixed" property was specifically added for the sake of slash notation. But there is also a utility function Chord::slash() that checks for "fixed" so you don't have to bake that into code elsewhere. The idea was eventually if slash became something a little more native, we would only have to change the definition of that utility function.
We chose to expose "fixed" in the Inspector because it turned out to have a fair number of other uses as well, plus it allows you to specify which line you want your slashes on. It's definitely a shame it's no longer exposed and I'd still argue in favor of its return. Meanwhile, I did create a plugin to allow it to be set explicitly where needed.
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.
Thanks @MarcSabatella!
@miiizen In that case I'd suggest to replace item->fixed()
with item->chord()->slash()
; the effect will be the same, but at least the meaning of the added code will be a lot clearer for the future, I think.
New information was provided by Marc
049ac6f
to
d2a9bd2
Compare
Resolves: #19610
Dot's lines aren't adjusted when rhythmic slashes are on. All but one dot is made invisible as we do with the noteheads.