From 30f55f72f68c297b940b849c4c4d7addf490a027 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 9 Nov 2021 18:05:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E3=80=90=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?=E3=80=91=E6=8E=92=E7=89=88=E6=95=B4=E9=BD=90=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E6=96=B0=E5=BB=BA=E8=A7=86=E5=9B=BE=EF=BC=8C?= =?UTF-8?q?=E5=90=91=E4=BB=AA=E8=A1=A8=E6=9D=BF=E4=B8=AD=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=EF=BC=8C=E4=BD=8D=E7=BD=AE=E6=9C=89=E4=BA=9B=E9=94=99=E4=B9=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/custom-component/component-list.js | 2 +- frontend/src/views/panel/edit/index.vue | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/canvas/custom-component/component-list.js b/frontend/src/components/canvas/custom-component/component-list.js index 5e7842a141..042b93abc3 100644 --- a/frontend/src/components/canvas/custom-component/component-list.js +++ b/frontend/src/components/canvas/custom-component/component-list.js @@ -224,7 +224,7 @@ const list = [ borderRadius: '' }, x: 1, - y: 1, + y: 36, sizex: 10, sizey: 6, auxiliaryMatrix: true diff --git a/frontend/src/views/panel/edit/index.vue b/frontend/src/views/panel/edit/index.vue index e4c5abac0d..5e756bd6d7 100644 --- a/frontend/src/views/panel/edit/index.vue +++ b/frontend/src/views/panel/edit/index.vue @@ -788,9 +788,19 @@ export default { } }) + component.auxiliaryMatrix = this.canvasStyleData.auxiliaryMatrix // position = absolution 或导致有偏移 这里中和一下偏移量 - component.style.top = 0 - component.style.left = 600 + if (this.canvasStyleData.auxiliaryMatrix) { + component.style.left = (component.x - 1) * this.curCanvasScale.matrixStyleOriginWidth + component.style.top = (component.y - 1) * this.curCanvasScale.matrixStyleOriginHeight + component.style.width = component.sizex * this.curCanvasScale.matrixStyleOriginWidth + component.style.height = component.sizey * this.curCanvasScale.matrixStyleOriginHeight + } else { + component.style.left = 0 + component.style.top = 0 + component.x = 1 + component.y = 1 + } component.id = newComponentId this.$store.commit('addComponent', { component }) this.$store.commit('recordSnapshot', 'newViewInfo')