console 제거 및 line 길이 표시 수정
This commit is contained in:
parent
e53bddc04c
commit
98c37b725a
@ -75,7 +75,7 @@ export const QLine = fabric.util.createClass(fabric.Line, {
|
|||||||
const y2 = this.top + this.height * scaleY
|
const y2 = this.top + this.height * scaleY
|
||||||
const dx = x2 - x1
|
const dx = x2 - x1
|
||||||
const dy = y2 - y1
|
const dy = y2 - y1
|
||||||
this.length = Number(Math.sqrt(dx * dx + dy * dy).toFixed(1)) * 10
|
this.length = Number(Math.sqrt(dx * dx + dy * dy).toFixed(0))
|
||||||
},
|
},
|
||||||
|
|
||||||
addLengthText() {
|
addLengthText() {
|
||||||
@ -109,7 +109,7 @@ export const QLine = fabric.util.createClass(fabric.Line, {
|
|||||||
const maxY = this.top + this.length
|
const maxY = this.top + this.length
|
||||||
const degree = (Math.atan2(y2 - y1, x2 - x1) * 180) / Math.PI
|
const degree = (Math.atan2(y2 - y1, x2 - x1) * 180) / Math.PI
|
||||||
|
|
||||||
const text = new fabric.Textbox(this.length.toFixed(0).toString(), {
|
const text = new fabric.Textbox(Number(this.length.toFixed(1) * 10).toString(), {
|
||||||
left: left,
|
left: left,
|
||||||
top: top,
|
top: top,
|
||||||
fontSize: this.fontSize,
|
fontSize: this.fontSize,
|
||||||
|
|||||||
@ -246,12 +246,10 @@ export function useRoofShapeSetting() {
|
|||||||
const polygon = addPolygonByLines(outerLines, { name: 'wallLine' })
|
const polygon = addPolygonByLines(outerLines, { name: 'wallLine' })
|
||||||
polygon.lines = [...outerLines]
|
polygon.lines = [...outerLines]
|
||||||
|
|
||||||
drawRoofPolygon(polygon)
|
const roof = drawRoofPolygon(polygon)
|
||||||
|
|
||||||
canvas?.renderAll()
|
canvas?.renderAll()
|
||||||
|
roof.drawHelpLine()
|
||||||
console.log(canvas.getObjects())
|
|
||||||
|
|
||||||
fn && fn(false)
|
fn && fn(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,6 +264,7 @@ export function useRoofShapeSetting() {
|
|||||||
(line.startPoint === outerLine.endPoint && line.endPoint === outerLine.startPoint)
|
(line.startPoint === outerLine.endPoint && line.endPoint === outerLine.startPoint)
|
||||||
) {
|
) {
|
||||||
outerLine.direction = line.direction
|
outerLine.direction = line.direction
|
||||||
|
outerLine.idx = line.idx
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user