This commit is contained in:
Jens Cornelsen
2024-12-09 15:31:18 +01:00
parent c49410d224
commit 17f7530bb8

View File

@@ -117,6 +117,11 @@ import Widget2 from "#components/Widget.svelte";
const endX = snapToGrid(e.offsetX); const endX = snapToGrid(e.offsetX);
const endY = snapToGrid(e.offsetY); const endY = snapToGrid(e.offsetY);
// Avoid drawing a "point" as a line
if (startX === endX && startY === endY) {
return;
}
// Draw the line // Draw the line
drawLine(startX, startY, endX, endY); drawLine(startX, startY, endX, endY);
@@ -143,6 +148,5 @@ import Widget2 from "#components/Widget.svelte";
drawGrid(); // Draw the grid when the page loads drawGrid(); // Draw the grid when the page loads
</script> </script>
</Layout> </Layout>