Procházet zdrojové kódy

Add debug coordinates

a green line represents the y axis, a red one the x axis.
pull/2/head
Wouter Horlings před 1 rokem
rodič
revize
2c532014ad
1 změnil soubory, kde provedl 21 přidání a 0 odebrání
  1. +21
    -0
      pkg/pattern/point/point.go

+ 21
- 0
pkg/pattern/point/point.go Zobrazit soubor

@@ -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)
}
}

Načítá se…
Zrušit
Uložit