polygon의 point가 3개 미만일 경우 처리
This commit is contained in:
parent
c95267e1bd
commit
b4f2272a6b
@ -33,6 +33,9 @@ export function useRoofFn() {
|
|||||||
if (!polygon) {
|
if (!polygon) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (polygon.points.length < 3) {
|
||||||
|
return
|
||||||
|
}
|
||||||
if (isForceChange && !isDisplay) {
|
if (isForceChange && !isDisplay) {
|
||||||
/*if (polygon.roofMaterial) {
|
/*if (polygon.roofMaterial) {
|
||||||
polygon.roofMaterial = null
|
polygon.roofMaterial = null
|
||||||
@ -156,7 +159,6 @@ export function useRoofFn() {
|
|||||||
combinedPatternCanvas.width = polygon.width * ratio
|
combinedPatternCanvas.width = polygon.width * ratio
|
||||||
combinedPatternCanvas.height = polygon.height * ratio
|
combinedPatternCanvas.height = polygon.height * ratio
|
||||||
const combinedCtx = combinedPatternCanvas.getContext('2d')
|
const combinedCtx = combinedPatternCanvas.getContext('2d')
|
||||||
|
|
||||||
// 첫 번째 패턴을 그린 후 두 번째 패턴을 덧입힘
|
// 첫 번째 패턴을 그린 후 두 번째 패턴을 덧입힘
|
||||||
combinedCtx.drawImage(patternSourceCanvas, 0, 0)
|
combinedCtx.drawImage(patternSourceCanvas, 0, 0)
|
||||||
combinedCtx.drawImage(hachingPatternSourceCanvas, 0, 0)
|
combinedCtx.drawImage(hachingPatternSourceCanvas, 0, 0)
|
||||||
|
|||||||
@ -12,7 +12,7 @@ export function useOrientation() {
|
|||||||
|
|
||||||
const { drawDirectionArrow } = usePolygon()
|
const { drawDirectionArrow } = usePolygon()
|
||||||
|
|
||||||
useEffect(() => {
|
/*useEffect(() => {
|
||||||
const roofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
const roofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
||||||
roofs.forEach((roof) => {
|
roofs.forEach((roof) => {
|
||||||
roof.set({
|
roof.set({
|
||||||
@ -20,7 +20,7 @@ export function useOrientation() {
|
|||||||
})
|
})
|
||||||
drawDirectionArrow(roof)
|
drawDirectionArrow(roof)
|
||||||
})
|
})
|
||||||
}, [])
|
}, [])*/
|
||||||
|
|
||||||
const nextStep = () => {
|
const nextStep = () => {
|
||||||
if (isNaN(compasDeg)) {
|
if (isNaN(compasDeg)) {
|
||||||
|
|||||||
@ -174,6 +174,9 @@ export const usePolygon = () => {
|
|||||||
* @param polygon
|
* @param polygon
|
||||||
*/
|
*/
|
||||||
const drawDirectionArrow = (polygon) => {
|
const drawDirectionArrow = (polygon) => {
|
||||||
|
if (polygon.points.length < 3) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const direction = polygon.direction
|
const direction = polygon.direction
|
||||||
if (!direction) {
|
if (!direction) {
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user