필요 없는 내용 삭제

This commit is contained in:
hyojun.choi 2024-07-08 12:58:38 +09:00
parent 002a895910
commit d0541b161d
2 changed files with 0 additions and 34 deletions

View File

@ -176,7 +176,6 @@ export function useCanvas(id) {
strokeWidth: 1, strokeWidth: 1,
selectable: false, selectable: false,
name: 'mouseLine', name: 'mouseLine',
strokeDashArray: [5, 5],
}, },
) )
@ -188,7 +187,6 @@ export function useCanvas(id) {
strokeWidth: 1, strokeWidth: 1,
selectable: false, selectable: false,
name: 'mouseLine', name: 'mouseLine',
strokeDashArray: [5, 5],
}, },
) )

View File

@ -62,38 +62,6 @@ export function useMode() {
} }
const editMode = () => { const editMode = () => {
let distanceText = null // 거리를 표시하는 텍스트 객체를 저장할 변수
canvas?.on('mouse:move', function (options) {
const pointer = canvas?.getPointer(options.e)
if (historyLines.current.length === 0) return
const direction = getDirection(historyLines.current[0], pointer)
// 각 선과 마우스 위치 사이의 거리를 계산합니다.
const dx = historyLines.current[0].x1 - pointer.x
const dy = 0
const minDistance = Math.sqrt(dx * dx + dy * dy)
// 거리를 표시하는 텍스트 객체를 생성하거나 업데이트합니다.
if (distanceText) {
distanceText.set({
left: pointer.x,
top: pointer.y,
text: `${minDistance.toFixed(2)}`,
})
} else {
distanceText = new fabric.Text(`${minDistance.toFixed(2)}`, {
left: pointer.x,
top: pointer.y,
fontSize: fontSize,
})
canvas?.add(distanceText)
}
// 캔버스를 다시 그립니다.
canvas?.renderAll()
})
canvas?.on('mouse:down', function (options) { canvas?.on('mouse:down', function (options) {
const pointer = canvas?.getPointer(options.e) const pointer = canvas?.getPointer(options.e)
const circle = new fabric.Circle({ const circle = new fabric.Circle({