QLine default direction 추가

This commit is contained in:
hyojun.choi 2024-07-23 18:08:38 +09:00
parent 0402b8ef05
commit 229c4eb876

View File

@ -1,4 +1,5 @@
import { fabric } from 'fabric' import { fabric } from 'fabric'
import { getDirection, getDirectionByPoint } from '@/util/canvas-util'
export class QLine extends fabric.Group { export class QLine extends fabric.Group {
line line
@ -39,7 +40,7 @@ export class QLine extends fabric.Group {
this.y2 = y2 this.y2 = y2
this.line = line this.line = line
this.fontSize = option.fontSize this.fontSize = option.fontSize
this.direction = option.direction this.direction = option.direction ?? getDirectionByPoint({ x: x1, y: y1 }, { x: x2, y: y2 })
this.parent = option.parent this.parent = option.parent
this.idx = option.idx this.idx = option.idx