Update App.js

This commit is contained in:
brausjonas
2023-07-07 14:31:42 +02:00
parent 3c531e31fb
commit c88ee9456b
+1 -8
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 + 2, e.pageY - moverHeight + 2, moverWidth - 4, moverHeight - 4) context.drawImage(hintCanvas, e.pageX - moverWidth + 3, e.pageY - moverHeight + 3, moverWidth - 6, moverHeight - 6, e.pageX - moverWidth + 3, e.pageY - moverHeight + 3, moverWidth - 6, moverHeight - 6)
hintContext.clearRect(0, 0, 5000, 3000) hintContext.clearRect(0, 0, 5000, 3000)
moverActive = false moverActive = false
mouseDownCanvas = false mouseDownCanvas = false
@@ -241,15 +241,8 @@ export default function App() {
} }
} else if (moverActive) { } else if (moverActive) {
hintContext.clearRect(0, 0, 5000, 3000) hintContext.clearRect(0, 0, 5000, 3000)
hintContext.setLineDash([10, 15])
hintContext.lineWidth = 3
hintContext.strokeStyle = "rgb(0, 0, 0)"
hintContext.drawImage(canvas, formAnchor.x, formAnchor.y, moverWidth, moverHeight, e.pageX - moverWidth, e.pageY - moverHeight, moverWidth, moverHeight) hintContext.drawImage(canvas, formAnchor.x, formAnchor.y, moverWidth, moverHeight, e.pageX - moverWidth, e.pageY - moverHeight, moverWidth, moverHeight)
hintContext.beginPath()
hintContext.rect(e.pageX - moverWidth, e.pageY - moverHeight, moverWidth, moverHeight)
hintContext.stroke()
} }
} }