선 작성 시 기본 attributes.planeSize 추가
This commit is contained in:
parent
4fdd7d55d0
commit
c501896f59
@ -10,7 +10,7 @@ import {
|
|||||||
} from '@/store/canvasAtom'
|
} from '@/store/canvasAtom'
|
||||||
import { QLine } from '@/components/fabric/QLine'
|
import { QLine } from '@/components/fabric/QLine'
|
||||||
import { basicSettingState } from '@/store/settingAtom'
|
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 { getDegreeByChon } from '@/util/canvas-util'
|
||||||
import { useText } from '@/hooks/useText'
|
import { useText } from '@/hooks/useText'
|
||||||
import { fontSelector } from '@/store/fontAtom'
|
import { fontSelector } from '@/store/fontAtom'
|
||||||
@ -31,6 +31,7 @@ export const useLine = () => {
|
|||||||
const addLine = (points = [], options) => {
|
const addLine = (points = [], options) => {
|
||||||
const line = new QLine(points, {
|
const line = new QLine(points, {
|
||||||
...options,
|
...options,
|
||||||
|
attributes: {},
|
||||||
fontSize: lengthText.fontSize.value,
|
fontSize: lengthText.fontSize.value,
|
||||||
fontFamily: lengthText.fontFamily.value,
|
fontFamily: lengthText.fontFamily.value,
|
||||||
})
|
})
|
||||||
@ -38,7 +39,7 @@ export const useLine = () => {
|
|||||||
if (line.length < 1) {
|
if (line.length < 1) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
line.attributes.planeSize = calcLinePlaneSize(line)
|
||||||
canvas?.add(line)
|
canvas?.add(line)
|
||||||
return line
|
return line
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user