diff --git a/src/components/fabric/QLine.js b/src/components/fabric/QLine.js index 7796e66e..44374c5e 100644 --- a/src/components/fabric/QLine.js +++ b/src/components/fabric/QLine.js @@ -1,4 +1,5 @@ import { fabric } from 'fabric' +import { getDirection, getDirectionByPoint } from '@/util/canvas-util' export class QLine extends fabric.Group { line @@ -39,7 +40,7 @@ export class QLine extends fabric.Group { this.y2 = y2 this.line = line 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.idx = option.idx