From b35c26e6dc15d10ef780a362674bb999f9678bda Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Mon, 11 Nov 2024 17:01:36 +0900 Subject: [PATCH] =?UTF-8?q?border=20=EC=A0=9C=EA=B1=B0=20=ED=9B=84=20polyg?= =?UTF-8?q?on=20=EB=82=B4=EB=B6=80=20=EC=84=A0=ED=83=9D=20=EC=8B=9C=20?= =?UTF-8?q?=ED=95=B4=EB=8B=B9=20polygon=20=EC=84=A0=ED=83=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/fabric/QPolygon.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/fabric/QPolygon.js b/src/components/fabric/QPolygon.js index ce4d93c7..aff3f1e0 100644 --- a/src/components/fabric/QPolygon.js +++ b/src/components/fabric/QPolygon.js @@ -131,10 +131,9 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, { this.on('selected', () => { Object.keys(this.controls).forEach((controlKey) => { - if (controlKey !== 'ml' && controlKey !== 'mr') { - this.setControlVisible(controlKey, false) - } + this.setControlVisible(controlKey, false) }) + this.set({ hasBorders: false }) }) this.on('removed', () => { @@ -191,7 +190,12 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, { line.endPoint = nextPoint this.lines.push(line) }) - // } + }, + + containsPoint: function (point) { + const isInside = this.inPolygon(point) + this.set('selectable', isInside) + return isInside }, // 보조선 그리기