-
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
Place cross staff dots correctly #19333
Place cross staff dots correctly #19333
Conversation
bool hasCrossNotes = c->staffMove(); | ||
Measure* m = c->measure(); | ||
if (!hasCrossNotes) { | ||
for (size_t i = c->vStaffIdx() + 1 * VOICES; i < c->vStaffIdx() + 2 * VOICES; ++i) { |
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.
It looks like some parentheses are missing here; adding 1 * VOICES
to something that is a staff index seems not a logical thing to do.
for (size_t i = c->vStaffIdx() + 1 * VOICES; i < c->vStaffIdx() + 2 * VOICES; ++i) { | |
for (size_t i = (c->vStaffIdx() + 1) * VOICES; i < (c->vStaffIdx() + 2) * VOICES; ++i) { |
But: why would you look at the staff below the "visual staff" of the item in question? Note that cross-staff notation can be created not only by moving notes to the staff below, but also by moving to the staff above. And both can happen simultaneously in the case of a three-staff instrument:
(Or perhaps I'm misunderstanding it completely; excuse me in that case)
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.
The chord passed into getNoteListForDots
is the top chord (lowest track number) on the stave, even if that top chord has been moved down from the stave above, so we can tell if that chord is cross staff easily. This loop is to check through all the voices on the staff below the one we are laying out to see if any voices have been moved up.
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.
Although, when doing some performance testing I realised this wasn't confined to the current part. It is now.
178690d
to
e76fdda
Compare
Move `m` up so that it can be reused; rename it to `measure`; inline `part`
e76fdda
to
1d0fe6c
Compare
Resolves: #19057
Dot layout now takes cross staff notes from staves above and below into account.