Skip to content

fix #9013 Adjust dot placement for upward hooks #9095

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

Merged
merged 3 commits into from
Sep 27, 2021

Conversation

asattely
Copy link
Contributor

@asattely asattely commented Sep 9, 2021

Resolves: #9013

Quick fix to move dots over if the stem is up and there is a hook on the chord and the chord's dot placement is left of the right bound of the hook:
image

@asattely
Copy link
Contributor Author

There are situations where the dot doesn't need to be adjusted, so this has been fixed with the most recent commit:
image

@asattely
Copy link
Contributor Author

image

@@ -1365,6 +1365,7 @@ qreal Chord::defaultStemLength() const
}

qreal normalStemLen = isSmall() ? 2.5 : 3.5;
/* We no longer need to adjust stem hight for dot-hook collisions (Issue #9095)
Copy link
Contributor

@Jojo-Schmitz Jojo-Schmitz Sep 10, 2021

Choose a reason for hiding this comment

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

Better use #if 0... #endif. Here you' might be creating a compiler warning "comment inside comment"

Copy link
Contributor

Choose a reason for hiding this comment

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

Better to remove this code completely

@Jojo-Schmitz
Copy link
Contributor

Rebase needed

Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 11, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 14, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 14, 2021
Sometimes the flag doesn't necessitate moving the dots
Also, now that the hook isn't being adjusted, I increased the offset by 0.25sp to move the dot slightly further from the hook
@asattely asattely force-pushed the dot-placement-for-flags branch from b1e483a to e1dd1b7 Compare September 15, 2021 20:52
@asattely

This comment was marked as resolved.

// the top dot in the chord, not the dot for this particular note:
qreal dotY = chord()->notes().back()->y() + chord()->notes().back()->dots().first()->pos().y();
if (chord()->dotPosX() < hookRight && dotY < hookBottom) {
d = chord()->hook()->width() + (0.25 * spatium());
Copy link
Contributor

Choose a reason for hiding this comment

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

are both these 0.25 the same number? If so can't we consolidate those into one variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are not. The first one is adding a little bit of margin to the bottom of a hook for collision detection purposes (because otherwise they could be still right next to each other and not be technically colliding), and the second adds margin to the right side of the hook. Vertical vs horizontal positioning.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for explaining.

@DmitryArefiev DmitryArefiev self-assigned this Sep 16, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 23, 2021
@DmitryArefiev
Copy link
Contributor

Checked #9013 on Win10.

Hi @asattely , It's better than it was. But I think the dot can be too far from note in some cases and can collide with rests:

02

Even comparing with a desired result from #9013 :
01

@Tantacrul @bkunda Please review

@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Sep 23, 2021

Which might mean that we'd need 3 different distances, no hook (or hook far enough), half hook (desired 1) and full hook (desired 2)?

@Tantacrul
Copy link
Contributor

This is very much an @oktophonie call

@DmitryArefiev
Copy link
Contributor

Found a minor bug about shadow note dot position and real dot position. Logged separately #9265

Dotted shadow note

@DmitryArefiev
Copy link
Contributor

Checked #9013 on Win10, Mac11.13.1, Linux Mint 20.2 - FIXED

Please merge into master

Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 24, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 26, 2021
@DmitryArefiev
Copy link
Contributor

@igorkorsukov @Eism Please merge into master

@igorkorsukov igorkorsukov merged commit ade857a into musescore:master Sep 27, 2021
@DmitryArefiev DmitryArefiev removed their assignment Sep 28, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Sep 29, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Oct 3, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Dec 7, 2021
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request May 12, 2022
Jojo-Schmitz pushed a commit to Jojo-Schmitz/MuseScore that referenced this pull request Mar 5, 2023
@musescore musescore deleted a comment from Jojo-Schmitz Jun 13, 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.

[MU4 Issue] Dots should be offset rightward to clear flag
6 participants