Compare commits
No commits in common. "d886bb135fc60d6b387b9b2ffe3a42bfdec96b1a" and "d8a7986120b1f1d22c6a925b3fdd5b83877a90d2" have entirely different histories.
d886bb135f
...
d8a7986120
@ -210,7 +210,6 @@ export const SAVE_KEY = [
|
|||||||
'toFixed',
|
'toFixed',
|
||||||
'startPoint',
|
'startPoint',
|
||||||
'endPoint',
|
'endPoint',
|
||||||
'editable',
|
|
||||||
'isSortedPoints',
|
'isSortedPoints',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@ -22,12 +22,12 @@ export function useCommonUtils() {
|
|||||||
const lengthTextFont = useRecoilValue(fontSelector('lengthText'))
|
const lengthTextFont = useRecoilValue(fontSelector('lengthText'))
|
||||||
const commonTextFont = useRecoilValue(fontSelector('commonText'))
|
const commonTextFont = useRecoilValue(fontSelector('commonText'))
|
||||||
const [commonUtils, setCommonUtilsState] = useRecoilState(commonUtilsState)
|
const [commonUtils, setCommonUtilsState] = useRecoilState(commonUtilsState)
|
||||||
const { addPopup, closeAll } = usePopup()
|
const { addPopup } = usePopup()
|
||||||
const { drawDirectionArrow, addLengthText } = usePolygon()
|
const { drawDirectionArrow, addLengthText } = usePolygon()
|
||||||
const { applyDormers } = useObjectBatch({})
|
const { applyDormers } = useObjectBatch({})
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (commonUtils.text || !commonUtils.text) {
|
if (commonUtils.text) {
|
||||||
commonTextMode()
|
commonTextMode()
|
||||||
} else if (commonUtils.dimension) {
|
} else if (commonUtils.dimension) {
|
||||||
commonDimensionMode()
|
commonDimensionMode()
|
||||||
@ -38,9 +38,7 @@ export function useCommonUtils() {
|
|||||||
|
|
||||||
const commonTextMode = () => {
|
const commonTextMode = () => {
|
||||||
let textbox
|
let textbox
|
||||||
closeAll()
|
|
||||||
if (commonUtils.text) {
|
if (commonUtils.text) {
|
||||||
setTimeout(() => {
|
|
||||||
commonTextKeyEvent()
|
commonTextKeyEvent()
|
||||||
addCanvasMouseEventListener('mouse:down', (event) => {
|
addCanvasMouseEventListener('mouse:down', (event) => {
|
||||||
const pointer = canvas?.getPointer(event.e)
|
const pointer = canvas?.getPointer(event.e)
|
||||||
@ -69,26 +67,6 @@ export function useCommonUtils() {
|
|||||||
textbox.enterEditing()
|
textbox.enterEditing()
|
||||||
textbox.selectAll()
|
textbox.selectAll()
|
||||||
})
|
})
|
||||||
}, 100)
|
|
||||||
} else {
|
|
||||||
const activeObject = canvas?.getActiveObject()
|
|
||||||
if (activeObject && activeObject.name === 'commonText') {
|
|
||||||
if (activeObject && activeObject.isEditing) {
|
|
||||||
if (activeObject.text === '') {
|
|
||||||
canvas?.remove(activeObject)
|
|
||||||
} else {
|
|
||||||
activeObject.exitEditing()
|
|
||||||
}
|
|
||||||
//정책 협의
|
|
||||||
const texts = canvas.getObjects().filter((obj) => obj.name === 'commonText')
|
|
||||||
texts.forEach((text) => {
|
|
||||||
text.set({ editable: false })
|
|
||||||
})
|
|
||||||
canvas.renderAll()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
initEvent()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user