외벽선, 배치면 작성 시 guideLine 추가
This commit is contained in:
parent
02b71f40d6
commit
30ad1850b6
@ -29,6 +29,7 @@ import {
|
|||||||
} from '@/store/outerLineAtom'
|
} from '@/store/outerLineAtom'
|
||||||
import { calculateAngle } from '@/util/qpolygon-utils'
|
import { calculateAngle } from '@/util/qpolygon-utils'
|
||||||
import { fabric } from 'fabric'
|
import { fabric } from 'fabric'
|
||||||
|
import { QLine } from '@/components/fabric/QLine'
|
||||||
|
|
||||||
//외벽선 그리기
|
//외벽선 그리기
|
||||||
export function useOuterLineWall(setShowOutlineModal) {
|
export function useOuterLineWall(setShowOutlineModal) {
|
||||||
@ -215,11 +216,11 @@ export function useOuterLineWall(setShowOutlineModal) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if (lastPoint.x === firstPoint.x && lastPoint.y === firstPoint.y) {
|
if (Math.abs(lastPoint.x - firstPoint.x) < 1 && Math.abs(lastPoint.y - firstPoint.y) < 1) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastPoint.x === firstPoint.x || lastPoint.y === firstPoint.y) {
|
if (Math.abs(lastPoint.x - firstPoint.x) < 1 || Math.abs(lastPoint.y - firstPoint.y) < 1) {
|
||||||
let isAllRightAngle = true
|
let isAllRightAngle = true
|
||||||
|
|
||||||
const firstPoint = points[0]
|
const firstPoint = points[0]
|
||||||
@ -238,38 +239,27 @@ export function useOuterLineWall(setShowOutlineModal) {
|
|||||||
if (isAllRightAngle) {
|
if (isAllRightAngle) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const line = new QLine([lastPoint.x, lastPoint.y, firstPoint.x, firstPoint.y], {
|
const line = addLine([lastPoint.x, lastPoint.y, firstPoint.x, firstPoint.y], {
|
||||||
stroke: 'grey',
|
stroke: 'grey',
|
||||||
strokeWidth: 1,
|
strokeWidth: 1,
|
||||||
selectable: false,
|
selectable: false,
|
||||||
name: 'helpGuideLine',
|
name: 'helpGuideLine',
|
||||||
})
|
})
|
||||||
|
|
||||||
canvas?.add(line)
|
|
||||||
addLineText(line)
|
|
||||||
} else {
|
} else {
|
||||||
const guideLine1 = new QLine([lastPoint.x, lastPoint.y, lastPoint.x, firstPoint.y], {
|
const guideLine1 = addLine([lastPoint.x, lastPoint.y, lastPoint.x, firstPoint.y], {
|
||||||
stroke: 'grey',
|
stroke: 'grey',
|
||||||
strokeWidth: 1,
|
strokeWidth: 1,
|
||||||
strokeDashArray: [1, 1, 1],
|
strokeDashArray: [1, 1, 1],
|
||||||
name: 'helpGuideLine',
|
name: 'helpGuideLine',
|
||||||
})
|
})
|
||||||
|
|
||||||
const guideLine2 = new QLine([guideLine1.x2, guideLine1.y2, firstPoint.x, firstPoint.y], {
|
const guideLine2 = addLine([guideLine1.x2, guideLine1.y2, firstPoint.x, firstPoint.y], {
|
||||||
stroke: 'grey',
|
stroke: 'grey',
|
||||||
strokeWidth: 1,
|
strokeWidth: 1,
|
||||||
strokeDashArray: [1, 1, 1],
|
strokeDashArray: [1, 1, 1],
|
||||||
name: 'helpGuideLine',
|
name: 'helpGuideLine',
|
||||||
})
|
})
|
||||||
if (guideLine1.length > 0) {
|
}
|
||||||
canvas?.add(guideLine1)
|
|
||||||
addLineText(guideLine1)
|
|
||||||
}
|
|
||||||
|
|
||||||
canvas?.add(guideLine2)
|
|
||||||
|
|
||||||
addLineText(guideLine2)
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
}, [points])
|
}, [points])
|
||||||
|
|
||||||
|
|||||||
@ -232,11 +232,11 @@ export function usePlacementShapeDrawing(setShowPlaceShapeDrawingModal) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if (lastPoint.x === firstPoint.x && lastPoint.y === firstPoint.y) {
|
if (Math.abs(lastPoint.x - firstPoint.x) < 1 && Math.abs(lastPoint.y - firstPoint.y) < 1) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastPoint.x === firstPoint.x || lastPoint.y === firstPoint.y) {
|
if (Math.abs(lastPoint.x - firstPoint.x) < 1 || Math.abs(lastPoint.y - firstPoint.y) < 1) {
|
||||||
let isAllRightAngle = true
|
let isAllRightAngle = true
|
||||||
|
|
||||||
const firstPoint = points[0]
|
const firstPoint = points[0]
|
||||||
@ -255,38 +255,27 @@ export function usePlacementShapeDrawing(setShowPlaceShapeDrawingModal) {
|
|||||||
if (isAllRightAngle) {
|
if (isAllRightAngle) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const line = new QLine([lastPoint.x, lastPoint.y, firstPoint.x, firstPoint.y], {
|
const line = addLine([lastPoint.x, lastPoint.y, firstPoint.x, firstPoint.y], {
|
||||||
stroke: 'grey',
|
stroke: 'grey',
|
||||||
strokeWidth: 1,
|
strokeWidth: 1,
|
||||||
selectable: false,
|
selectable: false,
|
||||||
name: 'helpGuideLine',
|
name: 'helpGuideLine',
|
||||||
})
|
})
|
||||||
|
|
||||||
canvas?.add(line)
|
|
||||||
addLineText(line)
|
|
||||||
} else {
|
} else {
|
||||||
const guideLine1 = new QLine([lastPoint.x, lastPoint.y, lastPoint.x, firstPoint.y], {
|
const guideLine1 = addLine([lastPoint.x, lastPoint.y, lastPoint.x, firstPoint.y], {
|
||||||
stroke: 'grey',
|
stroke: 'grey',
|
||||||
strokeWidth: 1,
|
strokeWidth: 1,
|
||||||
strokeDashArray: [1, 1, 1],
|
strokeDashArray: [1, 1, 1],
|
||||||
name: 'helpGuideLine',
|
name: 'helpGuideLine',
|
||||||
})
|
})
|
||||||
|
|
||||||
const guideLine2 = new QLine([guideLine1.x2, guideLine1.y2, firstPoint.x, firstPoint.y], {
|
const guideLine2 = addLine([guideLine1.x2, guideLine1.y2, firstPoint.x, firstPoint.y], {
|
||||||
stroke: 'grey',
|
stroke: 'grey',
|
||||||
strokeWidth: 1,
|
strokeWidth: 1,
|
||||||
strokeDashArray: [1, 1, 1],
|
strokeDashArray: [1, 1, 1],
|
||||||
name: 'helpGuideLine',
|
name: 'helpGuideLine',
|
||||||
})
|
})
|
||||||
if (guideLine1.length > 0) {
|
}
|
||||||
canvas?.add(guideLine1)
|
|
||||||
addLineText(guideLine1)
|
|
||||||
}
|
|
||||||
|
|
||||||
canvas?.add(guideLine2)
|
|
||||||
|
|
||||||
addLineText(guideLine2)
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
}, [points])
|
}, [points])
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@ export const useLine = () => {
|
|||||||
fontFamily: fontFamily,
|
fontFamily: fontFamily,
|
||||||
})
|
})
|
||||||
|
|
||||||
if (line.length === 0) {
|
if (line.length < 1) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user