Skip to content

Commit

Permalink
tabnote migrated
Browse files Browse the repository at this point in the history
  • Loading branch information
rvilarl committed May 9, 2021
1 parent 52af5db commit c2e013b
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 64 deletions.
5 changes: 2 additions & 3 deletions src/gracetabnote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
//
// See `tests/gracetabnote_tests.js` for usage examples.

import { TabNote } from './tabnote';
import { StaveNoteStruct } from './stavenote';
import { TabNote, TabNoteStruct } from './tabnote';

/** Implements Crace Tab Note. */
export class GraceTabNote extends TabNote {
Expand All @@ -18,7 +17,7 @@ export class GraceTabNote extends TabNote {
}

/** Constructor providing a stave note struct */
constructor(note_struct: StaveNoteStruct) {
constructor(note_struct: TabNoteStruct) {
super(note_struct, false);
this.setAttribute('type', 'GraceTabNote');

Expand Down
5 changes: 3 additions & 2 deletions src/tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const Flow = {
durationToNumber: durationToNumber,
getGlyphProps: getGlyphProps,
textWidth: textWidth,
tabToGlyph: tabToGlyph,
};

Flow.clefProperties = (clef) => {
Expand Down Expand Up @@ -215,7 +216,7 @@ Flow.integerToNote.table = {
11: 'B',
};

Flow.tabToGlyph = (fret, scale = 1.0) => {
function tabToGlyph(fret, scale = 1.0) {
let glyph = null;
let width = 0;
let shift_y = 0;
Expand All @@ -235,7 +236,7 @@ Flow.tabToGlyph = (fret, scale = 1.0) => {
getWidth: () => width * scale,
shift_y,
};
};
}

function textWidth(text) {
return 7 * text.toString().length;
Expand Down
Loading

0 comments on commit c2e013b

Please sign in to comment.