CAD
This commit is contained in:
@@ -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>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user