|
@@ -145,19 +145,51 @@ const calcNoteData = () => {
|
|
|
MeasureNumberXMLList.push(item.MeasureNumberXML);
|
|
|
} else {
|
|
|
if (item.multipleRestMeasures) {
|
|
|
- const preItem = selectData.staves.find(
|
|
|
- (n: any) => n.MeasureNumberXML === item.MeasureNumberXML - 1
|
|
|
- );
|
|
|
- if (preItem?.staveBox) {
|
|
|
- noteItem.staveBox = {
|
|
|
- left: preItem.staveBox.left,
|
|
|
- top: preItem.staveBox.top,
|
|
|
- width: preItem.staveBox.width,
|
|
|
- // height: preItem.staveBox.height,
|
|
|
- };
|
|
|
- selectData.staves.push(noteItem);
|
|
|
- MeasureNumberXMLList.push(item.MeasureNumberXML);
|
|
|
+ console.log(111111)
|
|
|
+ if (state.isCombineRender) {
|
|
|
+ state.vfmeasures.forEach((item: any, idx: number) => {
|
|
|
+ const measureNum = item.getAttribute('data-num') ? Number(item.getAttribute('data-num')) : -1;
|
|
|
+
|
|
|
+ })
|
|
|
+ let currentItem = null;
|
|
|
+ for (let index = 0; index < state.vfmeasures.length; index++) {
|
|
|
+ const element = state.vfmeasures[index];
|
|
|
+ const measureNum = element.getAttribute('data-num') ? Number(element.getAttribute('data-num')) : -1;
|
|
|
+ if (measureNum === item.MeasureNumberXML) {
|
|
|
+ currentItem = element
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ const staveBbox = currentItem?.querySelector('.vf-stave')?.getBoundingClientRect() || { x: 0, width: 0, y: 0, height: 0 };
|
|
|
+ if (currentItem) {
|
|
|
+ noteItem.staveBox = {
|
|
|
+ left: staveBbox.x - parentLeft + "px",
|
|
|
+ // top: ((item.stave.y || 0) - 5) * state.zoom + "px",
|
|
|
+ top: staveBbox.y - parentTop + "px",
|
|
|
+ width: staveBbox.width + "px",
|
|
|
+ height: staveBbox.height + "px",
|
|
|
+ // height: preItem.staveBox.height,
|
|
|
+ };
|
|
|
+ selectData.staves.push(noteItem);
|
|
|
+ MeasureNumberXMLList.push(item.MeasureNumberXML);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ const preItem = selectData.staves.find(
|
|
|
+ (n: any) => n.MeasureNumberXML === item.MeasureNumberXML - 1
|
|
|
+ );
|
|
|
+ if (preItem?.staveBox) {
|
|
|
+ noteItem.staveBox = {
|
|
|
+ left: preItem.staveBox.left,
|
|
|
+ top: preItem.staveBox.top,
|
|
|
+ width: preItem.staveBox.width,
|
|
|
+ // height: preItem.staveBox.height,
|
|
|
+ };
|
|
|
+ selectData.staves.push(noteItem);
|
|
|
+ MeasureNumberXMLList.push(item.MeasureNumberXML);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|