|
@@ -320,11 +320,11 @@ export const resetFormate = () => {
|
|
|
.forEach((t) => {
|
|
|
// console.log('文本123',t.textContent,'是否在可视区域内',isElementInViewport(t))
|
|
|
// D.C循环标记不在可视区域内,需要修复移动其位置信息
|
|
|
- if (t.textContent?.includes('D.C')) {
|
|
|
- if (!isElementInViewport(t)) {
|
|
|
- t.style.transform = `translateX(-40px)`;
|
|
|
- }
|
|
|
- }
|
|
|
+ // if (t.textContent?.includes('D.C')) {
|
|
|
+ // if (!isElementInViewport(t)) {
|
|
|
+ // t.style.transform = `translateX(-40px)`;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
vfbeams.forEach((curve) => {
|
|
|
const result = collisionDetection(t, curve);
|
|
|
const prePath: SVGAElement = t?.previousSibling as unknown as SVGAElement;
|
|
@@ -658,6 +658,20 @@ export const resetFormate = () => {
|
|
|
// }
|
|
|
});
|
|
|
|
|
|
+ // 修复D.C、D.S等渲染位置不对的问题
|
|
|
+ const repairWord = ["D.S.", "D.C."];
|
|
|
+ [...vfmeasures].forEach((measure: any) => {
|
|
|
+ const needRepairTexts = measure.querySelectorAll('text').length ? Array.from(measure.querySelectorAll('text'))?.filter((item: any) => repairWord.includes(item?.textContent)) : [];
|
|
|
+ if (needRepairTexts.length) {
|
|
|
+ // 该小节结束位置的x坐标
|
|
|
+ const measureCoordinate = measure?.querySelector('.vf-custom-bg')?.getBBox() || null
|
|
|
+ const measureEndX = measureCoordinate ? measureCoordinate?.x + measureCoordinate?.width - 30 : 0;
|
|
|
+ needRepairTexts.forEach((text: any) => {
|
|
|
+ text?.setAttribute('x', measureEndX)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
if (!state.isCombineRender && state.isSingleLine) {
|
|
|
transSinglePage();
|