From a1bc2bfc2fee262a013a7c577bf988a98bfaa49b Mon Sep 17 00:00:00 2001 From: whc <772778995@qq.com> Date: Thu, 30 Nov 2023 09:08:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=85=83=E7=B4=A0?= =?UTF-8?q?=E6=8A=98=E7=BA=BF=E7=BA=BF=E6=9D=A1=EF=BC=8C=E5=9C=A8=E6=8B=96?= =?UTF-8?q?=E6=8B=BD=E4=B8=A4=E7=AB=AF=E9=94=9A=E7=82=B9=E4=BC=9A=E9=87=8D?= =?UTF-8?q?=E7=BD=AE=E4=B8=AD=E9=97=B4=E9=94=9A=E7=82=B9=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Editor/Canvas/hooks/useDragLineElement.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/Editor/Canvas/hooks/useDragLineElement.ts b/src/views/Editor/Canvas/hooks/useDragLineElement.ts index 3ff50269..114d9d83 100644 --- a/src/views/Editor/Canvas/hooks/useDragLineElement.ts +++ b/src/views/Editor/Canvas/hooks/useDragLineElement.ts @@ -182,9 +182,9 @@ export default (elementList: Ref) => { end: end, } if (command === OperateLineHandlers.START || command === OperateLineHandlers.END) { - if (element.broken) newEl.broken = [(start[0] + end[0]) / 2, (start[1] + end[1]) / 2] - if (element.curve) newEl.curve = [(start[0] + end[0]) / 2, (start[1] + end[1]) / 2] - if (element.cubic) newEl.cubic = [[(start[0] + end[0]) / 2, (start[1] + end[1]) / 2], [(start[0] + end[0]) / 2, (start[1] + end[1]) / 2]] + if (element.broken) newEl.broken = [midX - minX, midY - minY] + if (element.curve) newEl.curve = [midX - minX, midY - minY] + if (element.cubic) newEl.cubic = [[c1X - minX, c1Y - minY], [c2X - minX, c2Y - minY]] } else if (command === OperateLineHandlers.C) { if (element.broken) newEl.broken = [midX - minX, midY - minY]