forked from github/dataease
style(数据大屏): 缩放样式调整
This commit is contained in:
parent
088a552e83
commit
f9d80c7587
@ -59,8 +59,24 @@ export function changeComponentsSizeWithScale(scale, changeAttrs = needToChangeA
|
|||||||
scale
|
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,
|
componentDataRef,
|
||||||
canvasStyleDataRef,
|
canvasStyleDataRef,
|
||||||
scaleWidth,
|
scaleWidth,
|
||||||
|
Loading…
Reference in New Issue
Block a user