Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rvilarl committed May 12, 2021
1 parent d3f3367 commit 7cfcd83
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/clef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface ClefAnnotation {
}

export interface ClefType {
point?: number;
point: number;
code: string;
line?: number;
}
Expand Down Expand Up @@ -54,49 +54,61 @@ export class Clef extends StaveModifier {
treble: {
code: 'gClef',
line: 3,
point: 0,
},
bass: {
code: 'fClef',
line: 1,
point: 0,
},
alto: {
code: 'cClef',
line: 2,
point: 0,
},
tenor: {
code: 'cClef',
line: 1,
point: 0,
},
percussion: {
code: 'restMaxima',
line: 2,
point: 0,
},
soprano: {
code: 'cClef',
line: 4,
point: 0,
},
'mezzo-soprano': {
code: 'cClef',
line: 3,
point: 0,
},
'baritone-c': {
code: 'cClef',
line: 0,
point: 0,
},
'baritone-f': {
code: 'fClef',
line: 2,
point: 0,
},
subbass: {
code: 'fClef',
line: 0,
point: 0,
},
french: {
code: 'gClef',
line: 4,
point: 0,
},
tab: {
code: '6stringTabClef',
point: 0,
},
};
}
Expand Down Expand Up @@ -126,7 +138,7 @@ export class Clef extends StaveModifier {
this.size = size;
}
this.clef.point = this.musicFont.lookupMetric(`clef.${this.size}.point`, 0);
this.glyph = new Glyph(this.clef.code, this.clef.point ?? 0, {
this.glyph = new Glyph(this.clef.code, this.clef.point, {
category: `clef.${this.clef.code}.${this.size}`,
});

Expand Down

0 comments on commit 7cfcd83

Please sign in to comment.