sschmidTU on get-nearest-staffentry-multirest
try fixing getNearestStaffEntry… (compare)
data-*
attributes to some of the SVG elements, and then immediately serialise with .outerHTML. The bug I'm struggling with is that sometimes the data-*
attributes are present in the output - and sometimes they are NOT. There's some race condition involved, probably, but I can't tell what is causing it..@sschmidTU for example some variables
// protected zoomUpdated: boolean = false;
// protected needBackendUpdate: boolean = false;
// protected rules!: EngravingRules;
// protected sheet?: MusicSheet;
// protected graphic?: GraphicalMusicSheet;
// protected drawer!: VexFlowMusicSheetDrawer;
// protected drawingParameters!: DrawingParameters;
and the private function reset
I create a class which extends the OpenSheetMusicDisplay.ts
and need override some function and needs call these variable. It's wonderful if the lib change the private
to protected
for extend
(sheet as any).member
to access them.
I think I have seen a method with a promising name, but I ended up doing something like this:
let graphicalMeasure = osmdInstance.graphic.getGraphicalMeasureFromSourceMeasureAndIndex(
measure,
0
);
let rect = document.createElementNS(SVGNS, 'rect');
if (graphicalMeasure && graphicalMeasure.stave) {
['x', 'y', 'width', 'height'].forEach(prop => {
rect.setAttribute(prop, graphicalMeasure.stave[prop]);
}
svg.appendChild(rect);
and styling the rect appropriately.