-
Notifications
You must be signed in to change notification settings - Fork 0
Fix(#177, #178): 화이트보드(지우개, 메모지) 관련 버그 수정 #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix(#177, #178): 화이트보드(지우개, 메모지) 관련 버그 수정 #179
Conversation
- 원인: 지우개의 selection:created 이벤트가 등록된 상태로 선택 툴에서 같은 이벤트가 발생해 그래픽 요소 삭제 - 해결: 툴이 바뀔 때마다 이벤트를 지워주는 코드가 있는데 selection:created도 지우도록 했습니다.
- 원인: 메모지에 공백을 입력시 텍스트를 디폴트 값으로 바꿔주게 구현이 되어있습니다. 개행만 하고 다른 텍스트를 입력하지 않았을 때를 체크하기 위해 모든 개행문자를 제거하고 글자 수를 체크합니다. 이 개행문자가 제거된 텍스트가 편집후 메모지의 텍스트 내용으로 갱신되기 때문에 문제가 발생했습니다. - 해결: 개행만하고 다른 문자를 입력하지 않는가를 체크하기 위해 개행을 제거하는 동작을 조건문 안에서만 실행되게 수정했습니다.
✅ Deploy Preview for boarlog ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
주말인데도 고생 많으셨습니다!
const handleMouseUp = (target: fabric.Object | undefined) => { | ||
if (!target) return; | ||
canvas.remove(target); | ||
}); | ||
}; | ||
|
||
canvas.on("selection:created", ({ selected }) => { | ||
const handleSelectionCreated = (selected: fabric.Object[] | undefined) => { | ||
if (activeTool === "eraser") { | ||
selected?.forEach((object) => canvas.remove(object)); | ||
} | ||
canvas.discardActiveObject().renderAll(); | ||
}); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
함수로 분리한 거 좋네요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드 잘 읽었습니다! 깔끔하게 정규식으로 처리하신 부분 좋습니다 :)
작업 개요
화이트보드(지우개, 메모지) 관련 버그 수정
작업 사항
fix: 지우개 툴 선택 후 선택툴 클릭시 요소 삭제 오류 해결 close #177
fix: 메모지 내에 입력한 개행이 사라지는 버그 close #178
고민한 점들(필수 X)
fix: 지우개 툴 선택 후 선택툴 클릭시 요소 삭제 오류 해결
원인: 지우개의 selection:created 이벤트가 등록된 상태로 선택 툴에서 같은 이벤트가 발생해 그래픽 요소 삭제
해결: 툴이 바뀔 때마다 이벤트를 지워주는 코드가 있는데 selection:created도 지우도록 했습니다.
fix: 메모지 내에 입력한 개행이 사라지는 버그
원인: 메모지에 공백을 입력시 텍스트를 디폴트 값으로 바꿔주게 구현이 되어있습니다.
개행만 하고 다른 텍스트를 입력하지 않았을 때를 체크하기 위해 모든 개행문자를 제거하고 글자 수를 체크합니다.
이 개행문자가 제거된 텍스트가 편집후 메모지의 텍스트 내용으로 갱신되기 때문에 문제가 발생했습니다.
해결: 개행만하고 다른 문자를 입력하지 않는가를 체크하기 위해 개행을 제거하는 동작을 조건문 안에서만 실행되게 수정했습니다.
추가 사항: 개행 뿐만 아니라 띄어쓰기로만 이뤄진 텍스트인가도 체크하도록 정규표현식을 수정했습니다.
스크린샷(필수 X)
2023-12-02.7.26.39.mov
2023-12-02.7.27.01.mov