diff --git a/src/hooks/useLine.js b/src/hooks/useLine.js index 30cc9ba9..3e1d72e6 100644 --- a/src/hooks/useLine.js +++ b/src/hooks/useLine.js @@ -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 }