diff --git a/src/components/floor-plan/modal/placementSurface/PlacementSurface.jsx b/src/components/floor-plan/modal/placementSurface/PlacementSurface.jsx index f95f9c2f..c06386b5 100644 --- a/src/components/floor-plan/modal/placementSurface/PlacementSurface.jsx +++ b/src/components/floor-plan/modal/placementSurface/PlacementSurface.jsx @@ -12,7 +12,7 @@ const PlacementSurface = forwardRef((props, refs) => { const num = ['①', '②', '③', '④', '⑤'] const getImageUrl = () => { if (xInversion && !yInversion) { - return `/static/images/canvas/shape/re_${(rotate - 2) % 4 !== 0 ? Math.abs((rotate - 2) % 4) * 90 + 'deg' : 'normal'}/plane_tab${id < 10 ? '0' + id : id}.svg` + return `/static/images/canvas/shape/re_${rotate % 4 !== 0 ? Math.abs(rotate % 4) * 90 + 'deg' : 'normal'}/plane_tab${id < 10 ? '0' + id : id}.svg` } if (!xInversion && yInversion) { @@ -20,7 +20,7 @@ const PlacementSurface = forwardRef((props, refs) => { } if (xInversion && yInversion) { - return `/static/images/canvas/shape/${(rotate + 2) % 4 !== 0 ? Math.abs((rotate + 2) % 4) * 90 + 'deg' : 'normal'}/plane_tab${id < 10 ? '0' + id : id}.svg` + return `/static/images/canvas/shape/${rotate % 4 !== 0 ? Math.abs(rotate % 4) * 90 + 'deg' : 'normal'}/plane_tab${id < 10 ? '0' + id : id}.svg` } if (rotate < 0) { diff --git a/src/components/floor-plan/modal/placementSurface/PlacementSurfaceSetting.jsx b/src/components/floor-plan/modal/placementSurface/PlacementSurfaceSetting.jsx index 263054cf..e321c52a 100644 --- a/src/components/floor-plan/modal/placementSurface/PlacementSurfaceSetting.jsx +++ b/src/components/floor-plan/modal/placementSurface/PlacementSurfaceSetting.jsx @@ -224,7 +224,7 @@ export default function PlacementSurfaceSetting({ id, pos = { x: 50, y: 230 } }) } const getScale = () => { - return `scale(${yInversion ? -1 : 1}, ${xInversion ? -1 : 1})` + return `scale(${xInversion !== yInversion ? -1 : 1}, 1)` } const getRotate = () => { @@ -236,9 +236,23 @@ export default function PlacementSurfaceSetting({ id, pos = { x: 50, y: 230 } }) surfaceRefs.yInversion = yInversion //상하반전 surfaceRefs.rotate = rotate * 90 //앵글 setIsHidden(true) + console.log('surfaceRefs', surfaceRefs) applySurfaceShape(surfaceRefs, selectedType, id) } + const handleRotate = () => {} + + const handleInversion = (type) => { + if (type === 'x') { + setXInversion(!xInversion) + setRotate(xInversion ? rotate + 2 : rotate - 2) + // setXInversion(!xInversion) + } else if (type === 'y') { + // setRotate(rotate + 2) + setYInversion(!yInversion) + } + } + useEffect(() => { setSelectedType(types[0]) }, []) @@ -280,8 +294,10 @@ export default function PlacementSurfaceSetting({ id, pos = { x: 50, y: 230 } })