roofPolygon의 originX,originY 수정
This commit is contained in:
parent
eebc85e352
commit
a4daba5863
@ -2,7 +2,7 @@ import { useRecoilValue } from 'recoil'
|
|||||||
import { canvasState } from '@/store/canvasAtom'
|
import { canvasState } from '@/store/canvasAtom'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { setSurfaceShapePattern } from '@/util/canvas-util'
|
import { setSurfaceShapePattern } from '@/util/canvas-util'
|
||||||
import { splitPolygonWithLines } from '@/util/qpolygon-utils'
|
import { drawDirectionArrow, splitPolygonWithLines } from '@/util/qpolygon-utils'
|
||||||
import { useSwal } from '@/hooks/useSwal'
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
|
|
||||||
// 지붕면 할당
|
// 지붕면 할당
|
||||||
@ -112,6 +112,7 @@ export function useRoofAllocationSetting(setShowRoofAllocationSettingModal) {
|
|||||||
|
|
||||||
roofs.forEach((roof) => {
|
roofs.forEach((roof) => {
|
||||||
setSurfaceShapePattern(roof)
|
setSurfaceShapePattern(roof)
|
||||||
|
drawDirectionArrow(roof)
|
||||||
})
|
})
|
||||||
setShowRoofAllocationSettingModal(false)
|
setShowRoofAllocationSettingModal(false)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import { useTempGrid } from '@/hooks/useTempGrid'
|
|||||||
import { useEffect, useRef } from 'react'
|
import { useEffect, useRef } from 'react'
|
||||||
import { distanceBetweenPoints, setSurfaceShapePattern } from '@/util/canvas-util'
|
import { distanceBetweenPoints, setSurfaceShapePattern } from '@/util/canvas-util'
|
||||||
import { fabric } from 'fabric'
|
import { fabric } from 'fabric'
|
||||||
import { calculateAngle } from '@/util/qpolygon-utils'
|
import { calculateAngle, drawDirectionArrow } from '@/util/qpolygon-utils'
|
||||||
import {
|
import {
|
||||||
placementShapeDrawingAngle1State,
|
placementShapeDrawingAngle1State,
|
||||||
placementShapeDrawingAngle2State,
|
placementShapeDrawingAngle2State,
|
||||||
@ -212,9 +212,13 @@ export function usePlacementShapeDrawing(setShowPlaceShapeDrawingModal) {
|
|||||||
strokeWidth: 3,
|
strokeWidth: 3,
|
||||||
selectable: true,
|
selectable: true,
|
||||||
name: POLYGON_TYPE.ROOF,
|
name: POLYGON_TYPE.ROOF,
|
||||||
|
originX: 'center',
|
||||||
|
originY: 'center',
|
||||||
|
direction: 'south',
|
||||||
})
|
})
|
||||||
|
|
||||||
setSurfaceShapePattern(roof)
|
setSurfaceShapePattern(roof)
|
||||||
|
drawDirectionArrow(roof)
|
||||||
|
|
||||||
lines.forEach((line) => {
|
lines.forEach((line) => {
|
||||||
removeLine(line)
|
removeLine(line)
|
||||||
|
|||||||
@ -1151,8 +1151,11 @@ export const splitPolygonWithLines = (polygon) => {
|
|||||||
fill: 'transparent',
|
fill: 'transparent',
|
||||||
strokeWidth: 3,
|
strokeWidth: 3,
|
||||||
name: POLYGON_TYPE.ROOF,
|
name: POLYGON_TYPE.ROOF,
|
||||||
|
originX: 'center',
|
||||||
|
originY: 'center',
|
||||||
selectable: true,
|
selectable: true,
|
||||||
defense: defense,
|
defense: defense,
|
||||||
|
direction: defense,
|
||||||
})
|
})
|
||||||
|
|
||||||
polygon.canvas.add(roof)
|
polygon.canvas.add(roof)
|
||||||
@ -3058,7 +3061,7 @@ export const drawDirectionArrow = (polygon) => {
|
|||||||
polygon.canvas.remove(polygon.arrow)
|
polygon.canvas.remove(polygon.arrow)
|
||||||
}
|
}
|
||||||
|
|
||||||
let centerPoint = { x: polygon.width / 2 + polygon.left, y: polygon.height / 2 + polygon.top }
|
let centerPoint = { x: polygon.left, y: polygon.top }
|
||||||
let stickeyPoint
|
let stickeyPoint
|
||||||
|
|
||||||
const polygonMaxX = Math.max(...polygon.getCurrentPoints().map((point) => point.x))
|
const polygonMaxX = Math.max(...polygon.getCurrentPoints().map((point) => point.x))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user