Compare commits
No commits in common. "d886bb135fc60d6b387b9b2ffe3a42bfdec96b1a" and "d8a7986120b1f1d22c6a925b3fdd5b83877a90d2" have entirely different histories.
d886bb135f
...
d8a7986120
@ -210,7 +210,6 @@ export const SAVE_KEY = [
|
||||
'toFixed',
|
||||
'startPoint',
|
||||
'endPoint',
|
||||
'editable',
|
||||
'isSortedPoints',
|
||||
]
|
||||
|
||||
|
||||
@ -22,12 +22,12 @@ export function useCommonUtils() {
|
||||
const lengthTextFont = useRecoilValue(fontSelector('lengthText'))
|
||||
const commonTextFont = useRecoilValue(fontSelector('commonText'))
|
||||
const [commonUtils, setCommonUtilsState] = useRecoilState(commonUtilsState)
|
||||
const { addPopup, closeAll } = usePopup()
|
||||
const { addPopup } = usePopup()
|
||||
const { drawDirectionArrow, addLengthText } = usePolygon()
|
||||
const { applyDormers } = useObjectBatch({})
|
||||
|
||||
useEffect(() => {
|
||||
if (commonUtils.text || !commonUtils.text) {
|
||||
if (commonUtils.text) {
|
||||
commonTextMode()
|
||||
} else if (commonUtils.dimension) {
|
||||
commonDimensionMode()
|
||||
@ -38,9 +38,7 @@ export function useCommonUtils() {
|
||||
|
||||
const commonTextMode = () => {
|
||||
let textbox
|
||||
closeAll()
|
||||
if (commonUtils.text) {
|
||||
setTimeout(() => {
|
||||
commonTextKeyEvent()
|
||||
addCanvasMouseEventListener('mouse:down', (event) => {
|
||||
const pointer = canvas?.getPointer(event.e)
|
||||
@ -69,26 +67,6 @@ export function useCommonUtils() {
|
||||
textbox.enterEditing()
|
||||
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