Skip to content

Commit

Permalink
preparation for stavenote migration
Browse files Browse the repository at this point in the history
  • Loading branch information
rvilarl committed Apr 21, 2021
1 parent aacf4f7 commit 6130c0f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/dot.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ export class Dot extends Modifier {
super();
this.setAttribute('type', 'Dot');

this.note = null;
this.index = null;
this.position = Modifier.Position.RIGHT;

this.radius = 2;
Expand All @@ -124,6 +122,7 @@ export class Dot extends Modifier {
this.radius *= 0.5;
this.setWidth(3);
}
return this;
}

setDotShiftY(y) {
Expand Down
8 changes: 4 additions & 4 deletions src/stem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ function L(
}

export interface StemOptions {
stem_down_y_base_offset: number;
stem_up_y_base_offset: number;
stem_down_y_offset: number;
stem_up_y_offset: number;
stem_down_y_base_offset?: number;
stem_up_y_base_offset?: number;
stem_down_y_offset?: number;
stem_up_y_offset?: number;
stemletHeight?: number;
isStemlet?: boolean;
hide?: boolean;
Expand Down
8 changes: 5 additions & 3 deletions src/stemmablenote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ export abstract class StemmableNote extends Note {
}

// Get/set the direction of the stem
getStemDirection(): number | undefined {
getStemDirection(): number {
if (!this.stem_direction) throw new Vex.RERR('NoStem', 'No stem attached to this note.');
return this.stem_direction;
}

Expand Down Expand Up @@ -188,8 +189,9 @@ export abstract class StemmableNote extends Note {
}

// Get the top and bottom `y` values of the stem.
getStemExtents(): Record<string, number> | undefined {
return this.stem?.getExtents();
getStemExtents(): Record<string, number> {
if (!this.stem) throw new Vex.RERR('NoStem', 'No stem attached to this note.');
return this.stem.getExtents();
}

/** Gets the `y` value for the top modifiers at a specific `textLine`. */
Expand Down

0 comments on commit 6130c0f

Please sign in to comment.