|
@@ -368,7 +368,7 @@ function getPointsPosByBatePos(): pointsPosType {
|
|
|
const frequencyLineData = quantileScale(frequencyData, 8, _canvasDomHeight - 8) // 最小值和最大值
|
|
|
const pointsPos = state.times.reduce((posArr: any[], item, index) => {
|
|
|
// 当休止小节,可能当前音符在谱面上没有实际的音符(没有bbox)
|
|
|
- if (item.bbox?.x != null && item.noteId != null) {
|
|
|
+ if (item.bbox?.x != null && ![-Infinity, Infinity].includes(item.bbox?.x) && item.noteId != null) {
|
|
|
posArr.push({
|
|
|
noteId: item.noteId,
|
|
|
MeasureNumberXML: item.MeasureNumberXML,
|
|
@@ -381,7 +381,7 @@ function getPointsPosByBatePos(): pointsPosType {
|
|
|
// 这里当第一个音符noteId为null,找不到前一个noteId,所以兼容一下
|
|
|
noteId: item.noteId != null ? item.noteId : (posArr[posArr.length - 1]?.noteId != null ? posArr[posArr.length - 1]?.noteId : -1) + 0.01, // 这里+0.01 是制造一个假id
|
|
|
MeasureNumberXML: item.MeasureNumberXML,
|
|
|
- x: item.bbox?.x != null ? item.bbox.x : posArr[posArr.length - 1]?.x || 10,
|
|
|
+ x: item.bbox?.x != null && ![-Infinity, Infinity].includes(item.bbox?.x) ? item.bbox.x : posArr[posArr.length - 1]?.x || 10,
|
|
|
y: _canvasDomHeight - frequencyLineData[index]
|
|
|
})
|
|
|
}
|