QPolygon 수정

This commit is contained in:
hyojun.choi 2024-07-31 10:55:36 +09:00
parent 71494d0369
commit 76d9a046a4

View File

@ -2,7 +2,7 @@ import { fabric } from 'fabric'
import { v4 as uuidv4 } from 'uuid'
import { QLine } from '@/components/fabric/QLine'
import { distanceBetweenPoints, findTopTwoIndexesByDistance, getDirectionByPoint, sortedPointLessEightPoint, sortedPoints } from '@/util/canvas-util'
import { drawHelpLineInHexagon2 } from '@/util/qpolygon-utils'
import { drawHelpLineInHexagon } from '@/util/qpolygon-utils'
export const QPolygon = fabric.util.createClass(fabric.Polygon, {
type: 'QPolygon',
@ -10,6 +10,9 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, {
texts: [],
id: null,
length: 0,
hips: [],
ridges: [],
connectRidges: [],
initialize: function (points, options, canvas) {
// 소수점 전부 제거
points.forEach((point) => {
@ -122,7 +125,7 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, {
// 보조선 그리기
drawHelpLine(chon = 4) {
drawHelpLineInHexagon2(this, chon)
drawHelpLineInHexagon(this, chon)
},
addLengthText() {
@ -313,4 +316,5 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, {
text.set({ visible: isView })
})
},
divideLine() {},
})