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

Hide extra dots when toggling rhythmic slashes #20175

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

miiizen
Copy link
Contributor

@miiizen miiizen commented Nov 24, 2023

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.

@miiizen miiizen force-pushed the 19610-slash-dots branch 2 times, most recently from 2f07ebe to 049ac6f Compare November 28, 2023 10:03
Comment on lines 3429 to 3422
if (item->fixed() && !item->visible()) {
item->setDotsHidden(true);
Copy link
Contributor

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 😊)

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

cbjeukendrup
cbjeukendrup previously approved these changes Dec 7, 2023
@cbjeukendrup cbjeukendrup dismissed their stale review December 7, 2023 23:51

New information was provided by Marc

@cbjeukendrup cbjeukendrup merged commit ff6fedd into musescore:master Dec 8, 2023
11 checks passed
@RomanPudashkin RomanPudashkin mentioned this pull request Dec 11, 2023
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.

Rhythmic Slash Notation from Dotted Chords Retains More than One Dot
4 participants