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

fix unnecessary shift #1372

Merged
merged 1 commit into from
Apr 11, 2022
Merged

fix unnecessary shift #1372

merged 1 commit into from
Apr 11, 2022

Conversation

rvilarl
Copy link
Collaborator

@rvilarl rvilarl commented Apr 4, 2022

fixes #1365
Only one visual difference:

StaveNote Note_Heads_Placement___Simple Bravura
current
StaveNote Note_Heads_Placement___Simple Bravura_current
reference
StaveNote Note_Heads_Placement___Simple Bravura_reference

@@ -259,6 +259,12 @@ export class StaveNote extends StemmableNote {
// shift lower voice right
noteL.note.setXShift(xShift);
}
} else if (noteU.note.hasStem()) {
noteU.stemDirection = -noteU.note.getStemDirection();
noteU.note.setStemDirection(noteU.stemDirection);
Copy link
Owner

Choose a reason for hiding this comment

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

Thanks Rodrigo. We should only change the stem direction in controlled situations. Can we move this into the if (voices != 2) branch? (otherwise we'll have weird issues with stems changing direction in other situations.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi Mohit, this is already, I believe, in a very controlled situation. All these conditions have to be fulfilled:

  • there are two voices
  • only one of the notes has stem (the other one is a whole)
  • they are not in the same line
  • they overlap (the stem overlaps with the whole)

There are no other visual differences in all the tests (this is the only one where the change of stem direction was applied)

Copy link
Owner

Choose a reason for hiding this comment

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

Thanks Rodrigo -- I didn't realize that this was inside the voices === 2 branch.

@0xfe
Copy link
Owner

0xfe commented Apr 11, 2022

Looks good, merging.

@0xfe 0xfe merged commit 561ce82 into 0xfe:master Apr 11, 2022
@rvilarl rvilarl deleted the fix/1365 branch December 27, 2022 08:05
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.

OSMD: unnecessary x-shift
2 participants