|
@@ -29,6 +29,8 @@ export class VexFlowStaffEntry extends GraphicalStaffEntry {
|
|
const tickable: Vex.Flow.StemmableNote = (gve as VexFlowVoiceEntry).vfStaveNote;
|
|
const tickable: Vex.Flow.StemmableNote = (gve as VexFlowVoiceEntry).vfStaveNote;
|
|
// This will let the tickable know how to calculate it's bounding box
|
|
// This will let the tickable know how to calculate it's bounding box
|
|
tickable.setStave(stave);
|
|
tickable.setStave(stave);
|
|
|
|
+ // setting Borders from Vexflow to OSMD
|
|
|
|
+ (gve as VexFlowVoiceEntry).applyBordersFromVexflow();
|
|
// The middle of the tickable is also the OSMD BoundingBox center
|
|
// The middle of the tickable is also the OSMD BoundingBox center
|
|
if (tickable.getAttribute("type") === "StaveNote") {
|
|
if (tickable.getAttribute("type") === "StaveNote") {
|
|
// The middle of the tickable is also the OSMD BoundingBox center
|
|
// The middle of the tickable is also the OSMD BoundingBox center
|
|
@@ -49,8 +51,9 @@ export class VexFlowStaffEntry extends GraphicalStaffEntry {
|
|
// const modifierOffset: number = 0;
|
|
// const modifierOffset: number = 0;
|
|
// sets the vexflow x positions back into the bounding boxes of the staff entries in the osmd object model.
|
|
// 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
|
|
// The positions are needed for cursor placement and mouse/tap interactions
|
|
- this.PositionAndShape.RelativePosition.x = (tickablePosition - stave.getNoteStartX() + modifierOffset) / unitInPixels
|
|
|
|
- + 0.5; // half note head offset
|
|
|
|
|
|
+ if (!(this.graphicalVoiceEntries[0] as VexFlowVoiceEntry).parentVoiceEntry.IsGrace) {
|
|
|
|
+ this.PositionAndShape.RelativePosition.x = (this.graphicalVoiceEntries[0] as VexFlowVoiceEntry).vfStaveNote.getBoundingBox().x / unitInPixels;
|
|
|
|
+ }
|
|
this.PositionAndShape.calculateBoundingBox();
|
|
this.PositionAndShape.calculateBoundingBox();
|
|
}
|
|
}
|
|
}
|
|
}
|