Skip to content

Commit

Permalink
refactor: clean up code a little
Browse files Browse the repository at this point in the history
  • Loading branch information
ZanzyTHEbar committed May 3, 2023
1 parent 53a3b93 commit 8c3f5f4
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions GUI/ETVR/src/views/CropSettings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,9 @@ const CropSettings = (props: IProps) => {

const onMouseUp = (e: MouseEvent) => {
const target = e.target as HTMLInputElement
if (target.nodeName !== 'CANVAS') return

// draw blue circle at the top-left and bottom-right vertex of the box

if (!isMouseDown() || target.nodeName !== 'CANVAS' || !context || !canvasRef) {
return
}

if (target.nodeName !== 'CANVAS' || !context || !canvasRef) return
setIsMouseDown(false)
const { x, y } = getMousePosition(canvasRef, e)

//* draw blue circle at mouse position
context.beginPath()
context.arc(x, y, 5, 0, 2 * Math.PI)
Expand Down

0 comments on commit 8c3f5f4

Please sign in to comment.