|
@@ -125,35 +125,35 @@ export default defineComponent({
|
|
|
const measureListIndex = activeNote.sourceMeasure.measureListIndex
|
|
|
|
|
|
// 如果没有节拍器,默认提前一个小节
|
|
|
- // if (index === 0 && measureListIndex !== 0 && !state.needTick) {
|
|
|
- // const firstNote = getFirsrNoteByMeasureListIndex(measureListIndex - 1)
|
|
|
- // const fnote = firstNote?.noteElement
|
|
|
- // if (fnote) {
|
|
|
- // // console.log(fnote.sourceMeasure?.measureListIndex, start.noteElement?.sourceMeasure?.measureListIndex)
|
|
|
- // for (
|
|
|
- // let j = fnote.sourceMeasure?.measureListIndex;
|
|
|
- // j < start.noteElement?.sourceMeasure?.measureListIndex;
|
|
|
- // j++
|
|
|
- // ) {
|
|
|
- // if (!seteds.includes(j)) {
|
|
|
- // for (const item of state.times) {
|
|
|
- // if (item.noteElement?.sourceMeasure?.measureListIndex === j && !seteds.includes(j)) {
|
|
|
- // const boundingBox = this.getBoundingBoxByNote(item.noteElement, {
|
|
|
- // before: true,
|
|
|
- // })
|
|
|
- // state.befireSection = item
|
|
|
- // if (!boundingBox) {
|
|
|
- // continue
|
|
|
- // }
|
|
|
- // state.sectionBoundingBoxs.push(boundingBox)
|
|
|
- // heights.push(boundingBox.height)
|
|
|
- // seteds.push(j)
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
+ if (index === 0 && measureListIndex !== 0 && !state.needTick) {
|
|
|
+ const firstNote = getFirsrNoteByMeasureListIndex(measureListIndex - 1)
|
|
|
+ const fnote = firstNote?.noteElement
|
|
|
+ if (fnote) {
|
|
|
+ // console.log(fnote.sourceMeasure?.measureListIndex, start.noteElement?.sourceMeasure?.measureListIndex)
|
|
|
+ for (
|
|
|
+ let j = fnote.sourceMeasure?.measureListIndex;
|
|
|
+ j < start.noteElement?.sourceMeasure?.measureListIndex;
|
|
|
+ j++
|
|
|
+ ) {
|
|
|
+ if (!seteds.includes(j)) {
|
|
|
+ for (const item of state.times) {
|
|
|
+ if (item.noteElement?.sourceMeasure?.measureListIndex === j && !seteds.includes(j)) {
|
|
|
+ const boundingBox = this.getBoundingBoxByNote(item.noteElement, {
|
|
|
+ before: true,
|
|
|
+ })
|
|
|
+ state.befireSection = item
|
|
|
+ if (!boundingBox) {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ state.sectionBoundingBoxs.push(boundingBox)
|
|
|
+ heights.push(boundingBox.height)
|
|
|
+ seteds.push(j)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
if (!seteds.includes(measureListIndex)) {
|
|
|
seteds.push(measureListIndex)
|