Browse Source

Add debug coordinates

a green line represents the y axis, a red one the x axis.
pull/2/head
Wouter Horlings 1 year ago
parent
commit
2c532014ad
1 changed files with 21 additions and 0 deletions
  1. +21
    -0
      pkg/pattern/point/point.go

+ 21
- 0
pkg/pattern/point/point.go View File

@@ -56,4 +56,25 @@ func Draw(c *canvas.Canvas, point Point, face *canvas.FontFace, debug bool) {


text := canvas.NewTextLine(face, point.Name(), canvas.Bottom) text := canvas.NewTextLine(face, point.Name(), canvas.Bottom)
c.RenderText(text, m.Translate(2, -4)) 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)
}
} }

Loading…
Cancel
Save