Alter 2 files

Update `drawing.go`
Update `imagegen.go`
This commit is contained in:
akp 2023-11-19 19:15:47 +00:00
parent 2e9b8cdfb0
commit e988d0b978
No known key found for this signature in database
GPG key ID: CF8D58F3DEB20755
2 changed files with 3 additions and 3 deletions

View file

@ -225,7 +225,7 @@ var weatherIcons = map[int]string{
30: "\uf01e", // Thunder
}
func drawTrains(ctx *canvas.Context, startFrom float64, services []string) (float64, error) {
func drawTrains(ctx *canvas.Context, startFrom float64, location string, services []string) (float64, error) {
cursorX := float64(0)
cursorY := startFrom + 15
startFrom += 15
@ -249,7 +249,7 @@ func drawTrains(ctx *canvas.Context, startFrom float64, services []string) (floa
ctx.DrawText(cursorX, cursorY, tl)
cursorX += bounds.W
ctx.DrawText(cursorX, cursorY, canvas.NewTextLine(fontMonoLittleSubtitle, " at SLY", canvas.Left))
ctx.DrawText(cursorX, cursorY, canvas.NewTextLine(fontMonoLittleSubtitle, " at " + location, canvas.Left))
}
cursorY += bounds.H + 10

View file

@ -55,7 +55,7 @@ func Generate(conf *Config) ([]byte, error) {
if err != nil {
return nil, err
}
bottom, err = drawTrains(ctx, bottom, trains)
bottom, err = drawTrains(ctx, bottom, conf.TrainsLocation, trains)
if err != nil {
return nil, err
}