refactor(图表): 3D旋转增加自动边界计算

This commit is contained in:
wangjiahao 2024-09-24 11:33:13 +08:00
parent af95fbe735
commit 14d3eaec47

View File

@ -829,6 +829,30 @@ const commonBackgroundSvgInner = computed(() => {
}
})
const padding3D = computed(() => {
const width = defaultStyle.value.width //
const height = defaultStyle.value.height //
const rotateX = element.value['multiDimensional'].x // X
const rotateY = element.value['multiDimensional'].y // Y
//
const radX = (rotateX * Math.PI) / 180
const radY = (rotateY * Math.PI) / 180
//
const newWidth = Math.abs(width * Math.cos(radY)) + Math.abs(height * Math.sin(radX))
const newHeight = Math.abs(height * Math.cos(radX)) + Math.abs(width * Math.sin(radY))
// padding
const paddingX = (newWidth - width) / 2
const paddingY = (newHeight - height) / 2
return {
paddingX: `${paddingX}px`,
paddingY: `${paddingY}px`
}
})
const componentBackgroundStyle = computed(() => {
if (element.value.commonBackground && element.value.component !== 'GroupArea') {
const {