-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 #293785: Fix #302590: Fix #294890: Chord symbols jump when user goes into edit… #5876
Fix #293785: Fix #302590: Fix #294890: Chord symbols jump when user goes into edit… #5876
Conversation
4f38f97
to
91c7282
Compare
It was reported this PR also solves #294890, added to comments. |
This PR changes the vtests, please have a look here: https://github.com/musescore/MuseScore/actions/runs/65207454 |
Thanks, I will have a look. |
If you update the PR and force push, you can see the results of vtests actions here: |
I believe you even get a notification about those failed vtests. Not sure why not in this case though? |
That's what I was hoping for ;-). But the hints of Antonio should make it possible for me to run these test locally (I only have a Linux installation :-)) |
I had a quick look at the differences. harmony-14 detects a real problem, the shapes of the |
the 3rd ones are to far to the left, they should end with the stem or the right edge of the notehead, but surely not to its left edge, just like the 1st ones are not aligning to the right edge, but to the left. |
The 3rd ones are too far to the left indeed because they were, like the texts, aligned to the fixed reference point, being the left edge of note head. Now I changed a alignment of the harmonies: |
Should be fine then. |
I can't say that the exact position of centering a chord symbol over a note is crucially important to me, because normally chord symbols are left-aligned anyhow. The current proposed alignment seems good. What's more important is to check the alignment in the presence of fretboard diagrams, because that's where centering matters. They need to center to the same reference point as the diagram, whatever that is. |
Fine by me |
Looks great! |
…es into edit mode This commit resolves two issues: Fix #302590 - Inconsistent alignment of chord name above fretboard Fix #293785 - Chord symbols jump when user goes into edit mode Fix #294890 - Spacing for center-aligned chords not honored until second layout When looking into #293785 it was found that placement of Harmonies above a FretDiagram was not consistent. o) Align::HCENTER aligns the horizontal centers of bot Harmony and FretDiagram. o) Align::RIGHT aligns the right edge of the Harmony roughly to the centrer of the FretDiagram. o) Align::LEFT aligns the left edge of the Harmony to the left edge of the FretDiagram. So every alignment uses it own reference. This has been corrected first. The root cause of #302590 was the difference of bounding box between NORMAL and EDIT mode. And this was caused because of the different formating between NORMAL and EDIT. In EDIT mode the horizontal alignment was using both different algorithm and reference. Also the height of the bounding box where different in EDIT and NORMAL mode To solve this the bounding box while in EDIT mode 1) is aligned exactly are in NORMAL mode 2) has the same height in both EDIT and NORMAL mode.
91c7282
to
9946fb7
Compare
I finally managed to to get all cases right (horizontal alignment, vertical alignment, above/below staff, normal/edit mode). |
In Harmony-13 with this PR the horizontal spacing in the second measure takes into account the presence of the chord symbol on the first note. I prefer this with respect to the original behavior: I think it becomes more readable. 👍 As I said, a change in vtests is not necessarily a change to the worse. |
As I said, I don't really care too much how the alignment works out for centered chords with no fret diagram, but I like the idea of centering over notehead. It's not super immediately obvious to me there is any noticeable difference in the before/after on harmony-13, though. When I look at the diff, it actually seems most of it is about the spacing of the notes, not the position of the chord symbols relative to the notes. So I guess that is what I'd want to be sure I understood. My first thought was that this is due to a change in the bbox/shape calculation, but now I think maybe it's something rather different, and directly related to the actual purpose of the PR. If I load the file into a current master, there is a layout shift on the next relayout, akin to the ones we see with fingerings. Without actually building this PR, my guess is that the changes have eliminated that layout shift, and thus the vtest is now seeing the "true" layout. In which case, it's a great change all around. If the layout shift is not fixed by this PR, then that is something to still look at I think, as it probably involves some of the same code. |
And actually, no that I read @AntonioBL 's last comment more carefully, I think he has nailed the source of the diff. This is exactly the change that happens in current master after the initial layout - the first note of the second measure moves to the right a bit in order to enforce that space to the first note with the chord symbol included in the shape. Personally, I'm not convinced that's better than not counting the chord symbol, but it's definitely better to not shift after first layout, an since this is only going to be an issue with centered chords, again, I really don't care one way or the other. Not shifting on relayout is a win. |
@AntonioBL do we need to update the vtest refs in the PRs that change the vtests results? Do the CI_vtests job compare vtest results with master or the ref files? |
@anatoly-os : sorry, I had not seen the notification. |
… mode
Resolves: https://musescore.org/en/node/302590
Resolves: https://musescore.org/en/node/293785
Resolves: https://musescore.org/en/node/294890
When looking into #293785 it was found that placement of Harmonies above a <code<FretDiagram was not consistent.
o)
Align::HCENTER
aligns the horizontal centers of bot Harmony andFretDiagram
.o)
Align::RIGHT
aligns the right edge of the Harmony roughly to the centre of the <code<FretDiagram.o)
Align::LEFT
aligns the left edge of the Harmony to the left edge of theFretDiagram
.So every alignment uses it own reference. This has been corrected first.
The root cause of #302590 was the difference of bounding box between NORMAL and EDIT mode. And this was caused because of the different formatting between NORMAL and EDIT. In EDIT mode the horizontal alignment was using both different algorithm and reference. Also the height of the bounding box where different in EDIT and NORMAL mode
To solve this the bounding box while in EDIT mode