|
@@ -459,13 +459,6 @@ export const resetFormate = () => {
|
|
|
// label.setAttribute("y", endY)
|
|
|
// }
|
|
|
// })
|
|
|
- dotModifiers.forEach((group: any) => {
|
|
|
- if (state.musicRenderType === 'fixedTone') {
|
|
|
- group.setAttribute('transform', 'translate(3,-12)')
|
|
|
- } else {
|
|
|
- group.setAttribute('transform', 'translate(3,-7)')
|
|
|
- }
|
|
|
- });
|
|
|
const vftextBottom = Array.from(staffline.querySelectorAll(".vf-text > text")).filter((n: any) => n.getBBox().y > stafflineCenter);
|
|
|
const vflineBottom = Array.from(staffline.querySelectorAll(".vf-line")).filter((n: any) => n.getBBox().y > stafflineCenter);
|
|
|
// 去重
|
|
@@ -643,6 +636,25 @@ export const resetFormate = () => {
|
|
|
state.vfmeasures = state.vfmeasures.concat(vfmeasures);
|
|
|
}
|
|
|
|
|
|
+ dotModifiers.forEach((group: any) => {
|
|
|
+ let parent = group?.parentElement; // 获取父元素
|
|
|
+ // 如果需要找更外层的祖先元素,可以一直迭代
|
|
|
+ while (parent && !parent.classList?.contains('vf-measure') && parent.tagName !== 'body' && parent) { // 假设你想找到最外层的 DIV
|
|
|
+ parent = parent.parentElement;
|
|
|
+ }
|
|
|
+ const parentY = parent?.querySelector('.vf-custom-bg').getBoundingClientRect()?.y || 0;
|
|
|
+ const dotY = group?.getBoundingClientRect()?.y || 0;
|
|
|
+ const distanceY = parentY - dotY;
|
|
|
+ const translateY = 15 - distanceY;
|
|
|
+ // console.log('距离111',translateY)
|
|
|
+ group.setAttribute('transform', `translate(3,${-translateY})`)
|
|
|
+ // if (state.musicRenderType === 'fixedTone') {
|
|
|
+ // // group.setAttribute('transform', 'translate(3,-12)')
|
|
|
+ // } else {
|
|
|
+ // // group.setAttribute('transform', 'translate(3,-7)')
|
|
|
+ // }
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
if (!state.isCombineRender && state.isSingleLine) {
|
|
|
transSinglePage();
|