Update App.js

This commit is contained in:
brausjonas
2023-07-07 12:18:30 +02:00
parent ddb334983c
commit 3c531e31fb
+3 -3
View File
@@ -123,7 +123,7 @@ export default function App() {
} }
else { else {
context.clearRect(formAnchor.x, formAnchor.y, moverWidth, moverHeight) context.clearRect(formAnchor.x, formAnchor.y, moverWidth, moverHeight)
context.drawImage(hintCanvas, e.pageX - moverWidth + 2, e.pageY - moverHeight + 2, moverWidth - 4, moverHeight - 4, e.pageX - moverWidth, e.pageY - moverHeight, moverWidth, moverHeight) context.drawImage(hintCanvas, e.pageX - moverWidth + 2, e.pageY - moverHeight + 2, moverWidth - 4, moverHeight - 4, e.pageX - moverWidth + 2, e.pageY - moverHeight + 2, moverWidth - 4, moverHeight - 4)
hintContext.clearRect(0, 0, 5000, 3000) hintContext.clearRect(0, 0, 5000, 3000)
moverActive = false moverActive = false
mouseDownCanvas = false mouseDownCanvas = false
@@ -169,14 +169,14 @@ export default function App() {
moverWidth = e.pageX - formAnchor.x moverWidth = e.pageX - formAnchor.x
moverHeight = e.pageY - formAnchor.y moverHeight = e.pageY - formAnchor.y
} }
}
if (selectedTool !== "text" && selectedTool !== "mover") { if (selectedTool !== "text") {
hintContext.clearRect(0, 0, 5000, 3000) hintContext.clearRect(0, 0, 5000, 3000)
} else { } else {
textInput.focus() textInput.focus()
} }
} }
}
function handleMouseMove(e) { function handleMouseMove(e) {
let mouseX = e.pageX let mouseX = e.pageX