CAD #174

Merged
IB-Cornelsen merged 1 commits from Jens into main 2024-12-09 19:27:12 +00:00

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() {