Update App.js

This commit is contained in:
brausjonas
2023-07-07 00:20:55 +02:00
parent 63f0cc183a
commit 092056b3ad
+4
View File
@@ -82,6 +82,7 @@ export default function App() {
} }
function handleMouseDownCanvas(e) { function handleMouseDownCanvas(e) {
if(e.button === 0) {
mouseDownCanvas = true mouseDownCanvas = true
hintContext.clearRect(0, 0, 5000, 3000) hintContext.clearRect(0, 0, 5000, 3000)
setShowTextInput(false) setShowTextInput(false)
@@ -108,8 +109,10 @@ export default function App() {
hintContext.fill() hintContext.fill()
} }
} }
}
function handleMouseUpCanvas(e) { function handleMouseUpCanvas(e) {
if(e.button === 0) {
mouseDownCanvas = false mouseDownCanvas = false
if (selectedTool === "rect") { if (selectedTool === "rect") {
@@ -148,6 +151,7 @@ export default function App() {
textInput.focus() textInput.focus()
} }
} }
}
function handleMouseMove(e) { function handleMouseMove(e) {
let mouseX = e.pageX let mouseX = e.pageX