webdaw-modules
Version:
a set of modules for building a web-based DAW
31 lines • 1.03 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMeasureBoundingBoxesInStave = void 0;
exports.getMeasureBoundingBoxesInStave = function (staveIndex, osmd) {
if (staveIndex === -1) {
return [];
}
var offsetX = osmd["container"].offsetLeft;
var offsetY = osmd["container"].offsetTop;
var boundingBoxes = [];
for (var i = 0; i < osmd.GraphicSheet.MeasureList.length; i++) {
var m = osmd.GraphicSheet.MeasureList[i];
var stave = m[staveIndex];
var _a = stave.stave, x = _a.x, y = _a.y, width = _a.width, height = _a.height;
x = x + offsetX;
y = y + offsetY;
height = (height / 5) * 4;
boundingBoxes.push({
x: x,
y: y,
width: width,
height: height,
left: x,
right: x + width,
top: y,
bottom: y + height,
});
}
return boundingBoxes;
};
//# sourceMappingURL=getMeasureBoundingBoxesInStave.js.map