From 2c532014adc4e8b8aecdb013d6ab4baade98bf27 Mon Sep 17 00:00:00 2001 From: Wouter Horlings Date: Mon, 8 Jul 2024 20:12:01 +0200 Subject: [PATCH] Add debug coordinates a green line represents the y axis, a red one the x axis. --- pkg/pattern/point/point.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pkg/pattern/point/point.go b/pkg/pattern/point/point.go index 9ee4db7..875f646 100644 --- a/pkg/pattern/point/point.go +++ b/pkg/pattern/point/point.go @@ -56,4 +56,25 @@ func Draw(c *canvas.Canvas, point Point, face *canvas.FontFace, debug bool) { text := canvas.NewTextLine(face, point.Name(), canvas.Bottom) c.RenderText(text, m.Translate(2, -4)) + + if debug { + yStyle := canvas.Style{ + Fill: canvas.Paint{}, + Stroke: canvas.Paint{Color: canvas.Green}, + StrokeWidth: 0.2, + StrokeCapper: canvas.RoundCap, + StrokeJoiner: canvas.BevelJoin, + } + yLine := canvas.Line(0, 10) + xStyle := canvas.Style{ + Fill: canvas.Paint{}, + Stroke: canvas.Paint{Color: canvas.Red}, + StrokeWidth: 0.2, + StrokeCapper: canvas.RoundCap, + StrokeJoiner: canvas.BevelJoin, + } + xLine := canvas.Line(10, 0) + c.RenderPath(yLine, yStyle, m) + c.RenderPath(xLine, xStyle, m) + } }