Skip to content

Commit

Permalink
fix(Cursor): fix x-position of cursor by half note head (general x po…
Browse files Browse the repository at this point in the history
…sition calc)
  • Loading branch information
sschmidTU committed Jul 23, 2018
1 parent 0d620c8 commit 6887f20
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/MusicalScore/Graphical/VexFlow/VexFlowStaffEntry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ export class VexFlowStaffEntry extends GraphicalStaffEntry {
// const modifierOffset: number = 0;
// sets the vexflow x positions back into the bounding boxes of the staff entries in the osmd object model.
// The positions are needed for cursor placement and mouse/tap interactions
this.PositionAndShape.RelativePosition.x = (tickablePosition - stave.getNoteStartX() + modifierOffset) / unitInPixels;
this.PositionAndShape.RelativePosition.x = (tickablePosition - stave.getNoteStartX() + modifierOffset) / unitInPixels
+ 0.5; // half note head offset
this.PositionAndShape.calculateBoundingBox();
}
}

0 comments on commit 6887f20

Please sign in to comment.