Skip to content

Commit

Permalink
Added start of debugrender functions. Not finished/not hooked up
Browse files Browse the repository at this point in the history
  • Loading branch information
seflless committed Oct 15, 2023
1 parent ce9d0f0 commit 9afbd3c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/renderer/DebugRenderer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Color, ColorToCSS } from "../colors/Color";

export function DebugLine2D(
svg: SVGElement,
x: number,
y: number,
x2: number,
y2: number,
stroke: Color = Color(0, 0, 0)
) {
const line = document.createElementNS("http://www.w3.org/2000/svg", "line");
line.setAttribute("x1", x.toFixed(2));
line.setAttribute("y1", y.toFixed(2));
line.setAttribute("x2", x2.toFixed(2));
line.setAttribute("y2", y2.toFixed(2));
line.setAttribute("stroke", ColorToCSS(stroke));
// line.setAttribute("stroke-width", "0.1");
svg.appendChild(line);
}

0 comments on commit 9afbd3c

Please sign in to comment.