Skip to content

Commit

Permalink
Merge pull request #1275 from rvilarl/fix/circularDependency
Browse files Browse the repository at this point in the history
Fix Circular Dependency Issue (using getCategory)
  • Loading branch information
0xfe authored Dec 28, 2021
2 parents 9b12482 + 4e265c3 commit d4550a1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/dot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { Modifier } from './modifier';
import { ModifierContextState } from './modifiercontext';
import { Note } from './note';
import { isStaveNote } from './stavenote';
import { isTabNote } from './tabnote';
import { isCategory } from './typeguard';
import { RuntimeError } from './util';

Expand Down Expand Up @@ -42,7 +41,7 @@ export class Dot extends Modifier {
const index = dot.checkIndex();
props = note.getKeyProps()[index];
shift = note.getRightDisplacedHeadPx();
} else if (isTabNote(note)) {
} else if (note.getCategory() === 'TabNote') {
props = { line: 0.5 }; // Shim key props for dot placement
shift = 0;
} else {
Expand Down Expand Up @@ -145,7 +144,7 @@ export class Dot extends Modifier {
const start = note.getModifierStartXY(this.position, this.index, { forceFlagRight: true });

// Set the starting y coordinate to the base of the stem for TabNotes.
if (isTabNote(note)) {
if (note.getCategory() === 'TabNote') {
start.y = note.getStemExtents().baseY;
}

Expand Down

0 comments on commit d4550a1

Please sign in to comment.