From 5ac023d72d5ae3f08dfe91724f8ee22b05336cc6 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 7 Jan 2026 10:35:24 +0900 Subject: [PATCH] =?UTF-8?q?[HANASYS=20DESIGN]=20=ED=9A=8C=EC=A0=84=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=EC=9D=84=20=EC=9D=B4=EC=9A=A9=ED=96=88?= =?UTF-8?q?=EC=9D=84=20=EB=95=8C=EC=9D=98=20=EB=B6=88=EB=9F=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/fabric/QPolygon.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/components/fabric/QPolygon.js b/src/components/fabric/QPolygon.js index b6c299d0..dbe6a9e3 100644 --- a/src/components/fabric/QPolygon.js +++ b/src/components/fabric/QPolygon.js @@ -181,8 +181,27 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, { return fabric.util.transformPoint(p, matrix) }) this.points = transformedPoints - const { left, top } = this.calcOriginCoords() - this.set('pathOffset', { x: left, y: top }) + + // 바운딩 박스 재계산 (width, height 업데이트 - fill 영역 수정) + const calcDim = this._calcDimensions({}) + this.width = calcDim.width + this.height = calcDim.height + + const newPathOffset = { + x: calcDim.left + this.width / 2, + y: calcDim.top + this.height / 2, + } + this.set('pathOffset', newPathOffset) + + // 변환을 points에 적용했으므로 left, top, angle, scale 모두 리셋 (이중 변환 방지) + this.set({ + left: newPathOffset.x, + top: newPathOffset.y, + angle: 0, + scaleX: 1, + scaleY: 1, + }) + this.setCoords() this.initLines() })