dev #496
@ -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) => {
|
||||||
|
|||||||
@ -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 {
|
|
||||||
ridgePoint.x2 += pointVector.x * offset
|
|
||||||
ridgePoint.y2 += pointVector.y * offset
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
ridgePoint.x2 += pointVector.x * 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
|
||||||
}
|
}
|
||||||
point[2] += pointVector.x * offset
|
if (oppLine.attributes.type === LINE_TYPE.WALLLINE.EAVES) {
|
||||||
point[3] += pointVector.y * offset
|
if (drivePoint) {
|
||||||
|
point[2] = drivePoint.x
|
||||||
|
point[3] = drivePoint.y
|
||||||
|
} else {
|
||||||
|
point[2] += pointVector.x * 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,13 +4810,17 @@ 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 (startOnLine && endOnLine) {
|
if (line.type === TYPES.RIDGE && baseLines.length === 4 && (startOnLine || endOnLine)) {
|
||||||
if (line.degree === 0) {
|
innerLines.push(drawRidgeLine([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))
|
} else {
|
||||||
} else {
|
if (startOnLine && endOnLine) {
|
||||||
innerLines.push(
|
if (line.degree === 0) {
|
||||||
drawHipLine([line.start.x, line.start.y, line.end.x, line.end.y], canvas, roof, textMode, null, line.degree, line.degree),
|
innerLines.push(drawRoofLine([line.start.x, line.start.y, line.end.x, line.end.y], canvas, roof, textMode))
|
||||||
)
|
} else {
|
||||||
|
innerLines.push(
|
||||||
|
drawHipLine([line.start.x, line.start.y, line.end.x, line.end.y], canvas, roof, textMode, null, line.degree, line.degree),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user