선 작성 시 기본 attributes.planeSize 추가

This commit is contained in:
hyojun.choi 2026-01-15 09:55:52 +09:00
parent 4fdd7d55d0
commit c501896f59

View File

@ -10,7 +10,7 @@ import {
} from '@/store/canvasAtom'
import { QLine } from '@/components/fabric/QLine'
import { basicSettingState } from '@/store/settingAtom'
import { calcLineActualSizeByLineLength } from '@/util/qpolygon-utils'
import { calcLineActualSizeByLineLength, calcLinePlaneSize } from '@/util/qpolygon-utils'
import { getDegreeByChon } from '@/util/canvas-util'
import { useText } from '@/hooks/useText'
import { fontSelector } from '@/store/fontAtom'
@ -31,6 +31,7 @@ export const useLine = () => {
const addLine = (points = [], options) => {
const line = new QLine(points, {
...options,
attributes: {},
fontSize: lengthText.fontSize.value,
fontFamily: lengthText.fontFamily.value,
})
@ -38,7 +39,7 @@ export const useLine = () => {
if (line.length < 1) {
return null
}
line.attributes.planeSize = calcLinePlaneSize(line)
canvas?.add(line)
return line
}