fix: 修复最后一个音符的增减时线不显示的问题

This commit is contained in:
2021-10-06 16:11:45 +08:00
parent 267fb2a023
commit c7a60dfd67
+5 -5
View File
@@ -87,14 +87,14 @@ function Paragraph({ paragraph, offsetY, alignJustify }) {
// 当前音符可能和下一个音符的增减时线连续,本次循环不绘制 // 当前音符可能和下一个音符的增减时线连续,本次循环不绘制
toIndex = i; toIndex = i;
} }
if (i === notations.length - 1) {
// 已是最后一个音符,直接绘制增减时线
lines.push(renderUnderLine(baseOffsetY, fromIndex, toIndex));
fromIndex = toIndex = -1;
}
} else { } else {
fromIndex = toIndex = i; fromIndex = toIndex = i;
} }
if (i === notations.length - 1) {
// 已是最后一个音符,直接绘制增减时线
lines.push(renderUnderLine(baseOffsetY, fromIndex, toIndex));
fromIndex = toIndex = -1;
}
--helpMap[i]; --helpMap[i];
} else { } else {
// 当前音符不需要绘制增减时线 // 当前音符不需要绘制增减时线