Skip to content

Commit

Permalink
code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronDavidNewman committed Jan 6, 2024
1 parent b35952b commit 770015f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/stave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,14 +443,15 @@ export class Stave extends Element {
}
return this;
}

/**
* treat the stave as if the clef is clefSpec, but don't display the clef
* @param clefSpec
*/
setClefLines(clefSpec: string) {
this.clef = clefSpec;
return this;
}

setClef(clefSpec: string, size?: string, annotation?: string, position?: number): this {
if (position === undefined) {
position = StaveModifierPosition.BEGIN;
Expand Down
5 changes: 2 additions & 3 deletions tests/keysignature_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,6 @@ function changeKey(options: TestOptions): void {

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.
const stave = f.Stave({ x: 10, y: 10, width: 800 }).addClef('bass').addTimeSignature('C|').setClefLines('bass');

const voice = f
Expand All @@ -390,7 +388,7 @@ function clefKeySignature(options: TestOptions): void {
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[]
f.KeySigNote({ key: 'D', alterKey: ['b', 'n'] }),
f.StaveNote({ keys: ['c/4'], duration: '1', clef: 'bass' }),
]);

Expand All @@ -400,5 +398,6 @@ function clefKeySignature(options: TestOptions): void {

options.assert.ok(true, 'all pass');
}

VexFlowTests.register(KeySignatureTests);
export { KeySignatureTests };

0 comments on commit 770015f

Please sign in to comment.