Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rvilarl committed Apr 9, 2021
1 parent 078d385 commit 3669f18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface ElementStyle {
*/
export abstract class Element {
protected static ID: number = 1000;
public context?: RenderContext;
private context?: RenderContext;
protected rendered: boolean;
protected style?: ElementStyle;
private attrs: ElementAttributes;
Expand Down
18 changes: 5 additions & 13 deletions src/note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,15 +256,13 @@ export abstract class Note extends Tickable {
render_options: NoteRenderOptions;
duration: string;
positions?: TabNotePositon[];

dots: number;
leftDisplacedHeadPx: number;
rightDisplacedHeadPx: number;
noteType: string;
customGlyphs: GlyphProps[];
ys: number[];
glyph: Glyph;

glyph: Glyph | GlyphProps;
customTypes: string[];
playNote?: Note;

Expand Down Expand Up @@ -502,7 +500,7 @@ export abstract class Note extends Tickable {
setStave(stave: Stave): this {
this.stave = stave;
this.setYs([stave.getYForLine(0)]); // Update Y values if the stave is changed.
this.context = this.stave.context;
this.setContext(this.stave.getContext());
return this;
}

Expand All @@ -512,12 +510,6 @@ export abstract class Note extends Tickable {
return Note.CATEGORY;
}

// Set the rendering context for the note.
setContext(context: RenderContext): this {
this.context = context;
return this;
}

// Get and set spacing to the left and right of the notes.
getLeftDisplacedHeadPx(): number {
return this.leftDisplacedHeadPx;
Expand Down Expand Up @@ -550,7 +542,7 @@ export abstract class Note extends Tickable {
}

// Get the glyph associated with this note.
getGlyph(): Glyph {
getGlyph(): Glyph | GlyphProps {
return this.glyph;
}

Expand All @@ -559,8 +551,8 @@ export abstract class Note extends Tickable {
if (this.glyph) {
if (this.glyph.getMetrics) {
return this.glyph.getMetrics().width;
// } else if (this.glyph.getWidth) {
// return this.glyph.getWidth(this.render_options.glyph_font_scale);
//} else if (this.glyph.getWidth) {
// return this.glyph.getWidth(this.render_options.glyph_font_scale);
}
}

Expand Down

0 comments on commit 3669f18

Please sign in to comment.