sschmidTU on get-nearest-staffentry-multirest
try fixing getNearestStaffEntry… (compare)
@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.