This commit is contained in:
Jens Cornelsen
2024-12-09 20:25:17 +01:00
parent 1c10a1fa5b
commit b866439729

View File

@@ -113,15 +113,25 @@ import Layout from "#layouts/layoutCAD.astro";
ctx.stroke();
}
// Clear the canvas and reset logs
function clearCanvas() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
capturedLines = [];
startX = null;
startY = null;
drawGrid(); // Redraw the grid after clearing
updateLineLog();
}
// Löscht den gesamten Canvas
ctx.clearRect(0, 0, canvas.width, canvas.height);
// Setzt die Liste der gezeichneten Linien und Punkte zurück
capturedLines = [];
firstStartPoint = null;
lastEndPoint = null;
// Zeichnet das Raster neu
drawGrid();
// Aktualisiert das Log, um es zu leeren
updateLineLog();
}
// Update the captured lines log
function updateLineLog() {