선 작성 시 기본 attributes.planeSize 추가
This commit is contained in:
parent
4fdd7d55d0
commit
c501896f59
@ -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
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user