From e988d0b9788682e21ad83d3ab5a4e41dc14c6e16 Mon Sep 17 00:00:00 2001 From: AKP Date: Sun, 19 Nov 2023 19:15:47 +0000 Subject: [PATCH] Alter 2 files Update `drawing.go` Update `imagegen.go` --- imagegen/drawing.go | 4 ++-- imagegen/imagegen.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/imagegen/drawing.go b/imagegen/drawing.go index b22acb4..a0e152e 100644 --- a/imagegen/drawing.go +++ b/imagegen/drawing.go @@ -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 diff --git a/imagegen/imagegen.go b/imagegen/imagegen.go index d0c0a8d..5f0814c 100644 --- a/imagegen/imagegen.go +++ b/imagegen/imagegen.go @@ -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 }