Skip to content

Commit

Permalink
fix: add onMouseLeave event for CanvasBoard component
Browse files Browse the repository at this point in the history
  • Loading branch information
Gumichocopengin8 committed Sep 1, 2024
1 parent 0234181 commit e9207e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions web/src/components/CanvasBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function CanvasBoard() {
ctx.closePath();
};

const mouseUp = async () => {
const inferenceData = async () => {
const inputCanvas = inputCanvasEle.current;
const scaledCanvas = scaledCanvasEle.current;
if (inputCanvas == null || scaledCanvas == null) {
Expand Down Expand Up @@ -154,7 +154,8 @@ function CanvasBoard() {
onMouseEnter={drawOnCanvas}
onMouseMove={drawOnCanvas}
onMouseDown={setPosition}
onMouseUp={mouseUp}
onMouseUp={inferenceData}
onMouseLeave={inferenceData}
ref={inputCanvasEle}
className='input-canvas'
/>
Expand Down

0 comments on commit e9207e3

Please sign in to comment.