Merge pull request #11452 from dataease/pr@dev-v2@style_fullscreen-scroll

style(数据大屏): 缩放样式调整
This commit is contained in:
王嘉豪 2024-08-08 19:13:46 +08:00 committed by GitHub
commit 53a4bc9c1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -59,8 +59,24 @@ export function changeComponentsSizeWithScale(scale, changeAttrs = needToChangeA
scale
})
}
export function changeRefComponentsSizeWithScale(componentDataRef, canvasStyleDataRef, scale) {
componentDataRef.forEach(component => {
Object.keys(component.style).forEach(key => {
if (needToChangeAttrs.includes(key)) {
if (key === 'fontSize' && component.style[key] === '') return
// 根据原来的比例获取样式原来的尺寸
// 再用原来的尺寸 * 现在的比例得出新的尺寸
component.style[key] = format(
getOriginStyle(component.style[key], canvasStyleDataRef.scale),
scale
)
}
})
})
canvasStyleDataRef.scale = scale
}
export function changeRefComponentsSizeWithScale(
export function changeRefComponentsSizeWithScalePoint(
componentDataRef,
canvasStyleDataRef,
scaleWidth,