dev #495

Merged
ysCha merged 3 commits from dev into dev-deploy 2025-12-18 11:29:38 +09:00
2 changed files with 30 additions and 14 deletions

View File

@ -116,6 +116,7 @@ export function useEavesGableEdit(id) {
useEffect(() => { useEffect(() => {
typeRef.current = type typeRef.current = type
radioTypeRef.current = '1'
}, [type]) }, [type])
const mouseOverEvent = (e) => { const mouseOverEvent = (e) => {

View File

@ -2957,11 +2957,12 @@ export const drawRoofByAttribute = (roofId, canvas, textMode) => {
ridgePoint.x2 += pointVector.x * offset ridgePoint.x2 += pointVector.x * offset
ridgePoint.y2 += pointVector.y * offset ridgePoint.y2 += pointVector.y * offset
} }
}
} else { } else {
ridgePoint.x2 += pointVector.x * offset ridgePoint.x2 += pointVector.x * offset
ridgePoint.y2 += pointVector.y * offset ridgePoint.y2 += pointVector.y * offset
} }
} // }
} else if (drivePoint) { } else if (drivePoint) {
ridgePoint.x2 = drivePoint.x ridgePoint.x2 = drivePoint.x
ridgePoint.y2 = drivePoint.y ridgePoint.y2 = drivePoint.y
@ -3398,8 +3399,18 @@ export const drawRoofByAttribute = (roofId, canvas, textMode) => {
default: default:
break break
} }
if (oppLine.attributes.type === LINE_TYPE.WALLLINE.EAVES) {
if (drivePoint) {
point[2] = drivePoint.x
point[3] = drivePoint.y
} else {
point[2] += pointVector.x * offset point[2] += pointVector.x * offset
point[3] += pointVector.y * offset point[3] += pointVector.y * offset
}
} else {
point[2] += pointVector.x * offset
point[3] += pointVector.y * offset
}
} else if (drivePoint) { } else if (drivePoint) {
point[2] = drivePoint.x point[2] = drivePoint.x
point[3] = drivePoint.y point[3] = drivePoint.y
@ -4316,8 +4327,8 @@ export const drawRoofByAttribute = (roofId, canvas, textMode) => {
const intersect = lineIntersection(currLine.start, currLine.end, nextLine.start, nextLine.end, canvas) const intersect = lineIntersection(currLine.start, currLine.end, nextLine.start, nextLine.end, canvas)
if (intersect) { if (intersect) {
const checkCircle = new fabric.Circle({ left: intersect.x, top: intersect.y, radius: 5, fill: 'blue', parentId: roofId, name: 'check' }) /*const checkCircle = new fabric.Circle({ left: intersect.x, top: intersect.y, radius: 5, fill: 'blue', parentId: roofId, name: 'check' })
canvas.add(checkCircle).renderAll() canvas.add(checkCircle).renderAll()*/
let distance1 = Math.sqrt(Math.pow(intersect.x - currLine.start.x, 2) + Math.pow(intersect.y - currLine.start.y, 2)) let distance1 = Math.sqrt(Math.pow(intersect.x - currLine.start.x, 2) + Math.pow(intersect.y - currLine.start.y, 2))
let distance2 = Math.sqrt(Math.pow(intersect.x - nextLine.start.x, 2) + Math.pow(intersect.y - nextLine.start.y, 2)) let distance2 = Math.sqrt(Math.pow(intersect.x - nextLine.start.x, 2) + Math.pow(intersect.y - nextLine.start.y, 2))
let point = [currLine.start.x, currLine.start.y, intersect.x, intersect.y] let point = [currLine.start.x, currLine.start.y, intersect.x, intersect.y]
@ -4799,6 +4810,9 @@ export const drawRoofByAttribute = (roofId, canvas, textMode) => {
allLinesPoints.filter((p) => almostEqual(p.x, line.start.x) && almostEqual(p.y, line.start.y)).length < 3 && allLinesPoints.filter((p) => almostEqual(p.x, line.start.x) && almostEqual(p.y, line.start.y)).length < 3 &&
allLinesPoints.filter((p) => almostEqual(p.x, line.end.x) && almostEqual(p.y, line.end.y)).length === 0 allLinesPoints.filter((p) => almostEqual(p.x, line.end.x) && almostEqual(p.y, line.end.y)).length === 0
) { ) {
if (line.type === TYPES.RIDGE && baseLines.length === 4 && (startOnLine || endOnLine)) {
innerLines.push(drawRidgeLine([line.start.x, line.start.y, line.end.x, line.end.y], canvas, roof, textMode))
} else {
if (startOnLine && endOnLine) { if (startOnLine && endOnLine) {
if (line.degree === 0) { if (line.degree === 0) {
innerLines.push(drawRoofLine([line.start.x, line.start.y, line.end.x, line.end.y], canvas, roof, textMode)) innerLines.push(drawRoofLine([line.start.x, line.start.y, line.end.x, line.end.y], canvas, roof, textMode))
@ -4809,6 +4823,7 @@ export const drawRoofByAttribute = (roofId, canvas, textMode) => {
} }
} }
} }
}
}) })
} }