diff --git a/core/frontend/src/components/deDrag/index.vue b/core/frontend/src/components/deDrag/index.vue index 6b55c8f8c9..7feff61116 100644 --- a/core/frontend/src/components/deDrag/index.vue +++ b/core/frontend/src/components/deDrag/index.vue @@ -1538,6 +1538,7 @@ export default { // Tab内部的画布ID 为 tab组件id + '-' + tabActiveName const targetCanvasId = this.tabMoveInActiveId + '-' + this.tabActiveTabNameMap[this.tabMoveInActiveId] const targetCanvasScale = this.curCanvasScaleMap[targetCanvasId] + const targetMainCanvasScale = this.curCanvasScaleMap['canvas-main'] if (this.element.auxiliaryMatrix) { this.element.x = 1 this.element.y = 108 @@ -1548,8 +1549,12 @@ export default { this.element.style.left = 0 this.element.style.top = (this.element.y - 1) * targetCanvasScale.matrixStyleOriginHeight } else { - this.element.style.left = 0 - this.element.style.top = 0 + this.element.style.left = 10 + this.element.style.top = 10 + const newWidth = this.element.style.width * targetMainCanvasScale.scalePointWidth / targetCanvasScale.scalePointWidth + const checkWidth = this.canvasStyleData.width - 30 + this.element.style.width = newWidth < checkWidth ? newWidth : checkWidth + this.element.style.height = this.element.style.height * targetMainCanvasScale.scalePointHeight / targetCanvasScale.scalePointHeight } this.element.canvasId = targetCanvasId }