방향 변수명 수정
This commit is contained in:
parent
2d510bbe02
commit
9187123225
@ -19,7 +19,7 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, {
|
|||||||
innerLines: [],
|
innerLines: [],
|
||||||
children: [],
|
children: [],
|
||||||
initOptions: null,
|
initOptions: null,
|
||||||
defense: null,
|
direction: null,
|
||||||
initialize: function (points, options, canvas) {
|
initialize: function (points, options, canvas) {
|
||||||
// 소수점 전부 제거
|
// 소수점 전부 제거
|
||||||
points.forEach((point) => {
|
points.forEach((point) => {
|
||||||
|
|||||||
@ -28,7 +28,8 @@ export const SurfaceShapeModal = ({ canvas }) => {
|
|||||||
const [length4, setLength4] = useState(0)
|
const [length4, setLength4] = useState(0)
|
||||||
const [length5, setLength5] = useState(0)
|
const [length5, setLength5] = useState(0)
|
||||||
|
|
||||||
const [defense, setDefense] = useState('south')
|
// 방향
|
||||||
|
const [direction, setDirection] = useState('south')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 최대 5개의 length
|
* 최대 5개의 length
|
||||||
@ -630,7 +631,7 @@ export const SurfaceShapeModal = ({ canvas }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
canvas?.add(obj)
|
canvas?.add(obj)
|
||||||
obj.set({ defense: defense })
|
obj.set({ direction: direction })
|
||||||
setCurrentPattern(obj)
|
setCurrentPattern(obj)
|
||||||
canvas?.renderAll()
|
canvas?.renderAll()
|
||||||
})
|
})
|
||||||
@ -848,30 +849,30 @@ export const SurfaceShapeModal = ({ canvas }) => {
|
|||||||
<div className="flex flex-col items-center">
|
<div className="flex flex-col items-center">
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<Button
|
<Button
|
||||||
className={`p-4 border rounded-lg ${defense === 'north' ? 'bg-blue-200' : ''} flex items-center justify-center`}
|
className={`p-4 border rounded-lg ${direction === 'north' ? 'bg-blue-200' : ''} flex items-center justify-center`}
|
||||||
onClick={() => setDefense('north')}
|
onClick={() => setDirection('north')}
|
||||||
>
|
>
|
||||||
북
|
북
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex space-x-4">
|
<div className="flex space-x-4">
|
||||||
<Button
|
<Button
|
||||||
className={`p-4 border rounded-lg ${defense === 'west' ? 'bg-blue-200' : ''} flex items-center justify-center`}
|
className={`p-4 border rounded-lg ${direction === 'west' ? 'bg-blue-200' : ''} flex items-center justify-center`}
|
||||||
onClick={() => setDefense('west')}
|
onClick={() => setDirection('west')}
|
||||||
>
|
>
|
||||||
서
|
서
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
className={`p-4 border rounded-lg ${defense === 'east' ? 'bg-blue-200' : ''} flex items-center justify-center`}
|
className={`p-4 border rounded-lg ${direction === 'east' ? 'bg-blue-200' : ''} flex items-center justify-center`}
|
||||||
onClick={() => setDefense('east')}
|
onClick={() => setDirection('east')}
|
||||||
>
|
>
|
||||||
동
|
동
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-4">
|
<div className="mt-4">
|
||||||
<Button
|
<Button
|
||||||
className={`p-4 border rounded-lg ${defense === 'south' ? 'bg-blue-200' : ''} flex items-center justify-center`}
|
className={`p-4 border rounded-lg ${direction === 'south' ? 'bg-blue-200' : ''} flex items-center justify-center`}
|
||||||
onClick={() => setDefense('south')}
|
onClick={() => setDirection('south')}
|
||||||
>
|
>
|
||||||
남
|
남
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@ -428,7 +428,6 @@ export function useCanvas(id) {
|
|||||||
'minY',
|
'minY',
|
||||||
'x',
|
'x',
|
||||||
'y',
|
'y',
|
||||||
'defense',
|
|
||||||
])
|
])
|
||||||
|
|
||||||
const str = JSON.stringify(objs)
|
const str = JSON.stringify(objs)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user