Merge branch 'dev' of https://git.jetbrains.space/nalpari/q-cast-iii/qcast-front into dev-ck
This commit is contained in:
commit
31dd93e0d8
@ -7,10 +7,14 @@ import { LINE_TYPE } from '@/common/common'
|
||||
import { useSwal } from '@/hooks/useSwal'
|
||||
|
||||
export default function PlacementSurfaceLineProperty(props) {
|
||||
const { id, pos = { x: 50, y: 230 }, roof } = props
|
||||
const { id, pos = { x: 50, y: 230 }, roof, setIsHidden } = props
|
||||
const { closePopup } = usePopup()
|
||||
// const { handleSetEaves, handleSetGable, handleRollback, handleFix, closeModal } = usePropertiesSetting(id)
|
||||
const { roofLinesInit, handleSetRidge, handleSetEaves, handleSetGable, handleRollback, handleFix } = useRoofLinePropertySetting(id, roof)
|
||||
const { roofLinesInit, handleSetRidge, handleSetEaves, handleSetGable, handleRollback, handleFix } = useRoofLinePropertySetting({
|
||||
id,
|
||||
roof,
|
||||
setIsHidden,
|
||||
})
|
||||
const { getMessage } = useMessage()
|
||||
const { swalFire } = useSwal()
|
||||
|
||||
@ -29,6 +33,10 @@ export default function PlacementSurfaceLineProperty(props) {
|
||||
}
|
||||
|
||||
closePopup(id)
|
||||
|
||||
if (setIsHidden) {
|
||||
setIsHidden(false)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@ -15,7 +15,8 @@ const LINE_COLOR = {
|
||||
ACTIVE: '#EA10AC',
|
||||
}
|
||||
|
||||
export function useRoofLinePropertySetting(id, roof) {
|
||||
export function useRoofLinePropertySetting(props) {
|
||||
const { id, roof, setIsHidden } = props
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
const currentObject = useRecoilValue(currentObjectState)
|
||||
const history = useRef([])
|
||||
@ -132,6 +133,7 @@ export function useRoofLinePropertySetting(id, roof) {
|
||||
|
||||
canvas.renderAll()
|
||||
closePopup(id)
|
||||
if (setIsHidden) setIsHidden(false)
|
||||
}
|
||||
|
||||
const nextLineFocus = (selectedLine) => {
|
||||
|
||||
@ -19,6 +19,8 @@ import { QLine } from '@/components/fabric/QLine'
|
||||
import { useRoofFn } from '@/hooks/common/useRoofFn'
|
||||
import { outerLinePointsState } from '@/store/outerLineAtom'
|
||||
import { placementShapeDrawingPointsState } from '@/store/placementShapeDrawingAtom'
|
||||
import PlacementSurfaceLineProperty from '@/components/floor-plan/modal/placementShape/PlacementSurfaceLineProperty'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
|
||||
export function useSurfaceShapeBatch({ isHidden, setIsHidden }) {
|
||||
const { getMessage } = useMessage()
|
||||
@ -34,7 +36,7 @@ export function useSurfaceShapeBatch({ isHidden, setIsHidden }) {
|
||||
const { swalFire } = useSwal()
|
||||
const { addCanvasMouseEventListener, initEvent } = useEvent()
|
||||
// const { addCanvasMouseEventListener, initEvent } = useContext(EventContext)
|
||||
const { closePopup } = usePopup()
|
||||
const { addPopup, closePopup } = usePopup()
|
||||
const { setSurfaceShapePattern } = useRoofFn()
|
||||
|
||||
const applySurfaceShape = (surfaceRefs, selectedType, id) => {
|
||||
@ -113,9 +115,13 @@ export function useSurfaceShapeBatch({ isHidden, setIsHidden }) {
|
||||
let imageRotate = 0
|
||||
if (xInversion && !yInversion) {
|
||||
if (rotate % 180 === 0 || rotate < 0) {
|
||||
imageRotate = Math.abs((rotate - 180) % 360)
|
||||
imageRotate = Math.abs(rotate % 360)
|
||||
} else {
|
||||
imageRotate = Math.abs((rotate + 180) % 4)
|
||||
if (rotate < 0) {
|
||||
imageRotate = Math.abs((rotate - 180) % 360)
|
||||
} else {
|
||||
imageRotate = Math.abs((rotate + 180) % 360)
|
||||
}
|
||||
}
|
||||
} else if (xInversion && yInversion) {
|
||||
imageRotate = Math.abs((rotate + 360) % 360)
|
||||
@ -132,7 +138,7 @@ export function useSurfaceShapeBatch({ isHidden, setIsHidden }) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
imageRotate = (rotate + 360) % 360
|
||||
imageRotate = (rotate + 4) % 4
|
||||
}
|
||||
obj.set({ angle: imageRotate })
|
||||
obj.setCoords() //좌표 변경 적용
|
||||
@ -188,10 +194,12 @@ export function useSurfaceShapeBatch({ isHidden, setIsHidden }) {
|
||||
setSurfaceShapePattern(batchSurface, roofDisplay.column)
|
||||
drawDirectionArrow(batchSurface)
|
||||
|
||||
if (setIsHidden) setIsHidden(false)
|
||||
// if (setIsHidden) setIsHidden(false)
|
||||
|
||||
// closePopup(id)
|
||||
initEvent()
|
||||
const popupId = uuidv4()
|
||||
addPopup(popupId, 2, <PlacementSurfaceLineProperty roof={batchSurface} id={popupId} setIsHidden={setIsHidden} />)
|
||||
})
|
||||
} else {
|
||||
if (setIsHidden) setIsHidden(false)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user