fix(数据大屏): 修复跑马灯组件预览字体和编辑字体大小不一致问题#16323 (#16678)

This commit is contained in:
王嘉豪
2025-08-12 14:21:41 +08:00
committed by GitHub
parent a9de3f6f31
commit 4536aacab4

View File

@@ -61,6 +61,7 @@ function changeComponentsSizeWithScaleCircle(componentDataCopy, scale) {
changeComponentsSizeWithScaleCircle(tabItem.componentData, scale)
})
} else {
changeComponentsSizeWithScaleCircle(componentInner.propValue, scale)
groupItemStyleAdaptor(componentInner, parentStyle)
}
})
@@ -117,7 +118,7 @@ export function changeRefComponentsSizeWithScale(componentDataRef, canvasStyleDa
canvasStyleDataRef.scale = scale
}
export function changeRefComponentsSizeWithScalePoint(
export function changeRefComponentsSizeWithScalePointCircle(
componentDataRef,
canvasStyleDataRef,
scaleWidth,
@@ -126,7 +127,6 @@ export function changeRefComponentsSizeWithScalePoint(
) {
componentDataRef.forEach(component => {
Object.keys(component.style).forEach(key => {
if (key === 'fontSize' && component.style[key] === '') return
if (needToChangeDirectionAttrs.width.includes(key)) {
// 根据原来的比例获取样式原来的尺寸
// 再用原来的尺寸 * 现在的比例得出新的尺寸
@@ -143,7 +143,32 @@ export function changeRefComponentsSizeWithScalePoint(
)
}
})
if (component.component === 'Group') {
changeRefComponentsSizeWithScalePointCircle(
component.propValue,
canvasStyleDataRef,
scaleWidth,
scaleHeight,
outScale
)
}
})
}
export function changeRefComponentsSizeWithScalePoint(
componentDataRef,
canvasStyleDataRef,
scaleWidth,
scaleHeight,
outScale
) {
changeRefComponentsSizeWithScalePointCircle(
componentDataRef,
canvasStyleDataRef,
scaleWidth,
scaleHeight,
outScale
)
canvasStyleDataRef.scale = scaleWidth
canvasStyleDataRef.scaleWidth = scaleWidth
canvasStyleDataRef.scaleHeight = scaleHeight