-
Notifications
You must be signed in to change notification settings - Fork 666
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
issue #1603 - key signature on non-treble stave, no glyph #1606
Conversation
None of our test cases had clef with non-default clef (e.g. bass) and a key signature, without the clef symbol displayed. I added a test case and created a 'addClefLines' that adds the logical clef (e.g. the lines match the clef) but without the glyph.
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.
I have done some minor comments. They are not must do.
src/stave.ts
Outdated
|
||
/** | ||
* treat the stave as if the clef is clefSpec, but don't display the clef | ||
* @param clefSpec |
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.
@param is no longer needed.
@@ -443,7 +443,14 @@ export class Stave extends Element { | |||
} | |||
return this; | |||
} | |||
|
|||
/** |
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.
Please leave a space before and after the function.
tests/keysignature_tests.ts
Outdated
function clefKeySignature(options: TestOptions): void { | ||
const f = VexFlowTests.makeFactory(options, 900); | ||
|
||
// The previous code was buggy: f.Stave(10, 10, 800), even though Factory.Stave() only accepts 1 argument. |
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.
Remove comment.
tests/keysignature_tests.ts
Outdated
f.KeySigNote({ key: 'Bb' }), | ||
f.StaveNote({ keys: ['c/4'], duration: '1', clef: 'bass' }), | ||
f.BarNote(), | ||
f.KeySigNote({ key: 'D', alterKey: ['b', 'n'] }), // TODO: alterKey needs to be a string[] |
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.
Remove comment.
f.draw(); | ||
|
||
options.assert.ok(true, 'all pass'); | ||
} |
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.
Add a line after the function.
@AaronDavidNewman Thanks for the PR, let me know if you prefer to do the changes or just to let it and merge. Also, would you like to do the same PR in Vexflow 5 or should I do it? |
After the merge, you can try to cherry pick the commit and apply it to the V5 repo (assuming the modified file isn't substantially different). That way the authorship is preserved, I believe. (Or Aaron can submit the V5 PR himself.) |
I updated based on comments and I'll merge it in. I'll look at vex5 soon and submit a PR. |
Prior to this fix, there was no way to show a key signature correctly in a bass clef stave, without the clef glyph (and any other non-treble). I added a test case and created a
stave.addClefLines(clefSpec: string)
method that adds the logical clef (e.g. the lines match the clef) but without the glyph.