From a6dc2b71f42a22a1d2b7f017516d01bdd7901f13 Mon Sep 17 00:00:00 2001 From: memmaker <4145035+memmaker@users.noreply.github.com> Date: Sat, 7 Jan 2023 15:53:42 +0100 Subject: [PATCH] Update font.go Bugfix --- font/font.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/font/font.go b/font/font.go index 5602cf2..59f9ac3 100644 --- a/font/font.go +++ b/font/font.go @@ -55,7 +55,7 @@ func NewFromReader(reader io.Reader, tileWidth, tileHeight int) (*Font, error) { // ToSubImage extracts the image of a given char from the base image of the font. func (f *Font) ToSubImage(char int) *ebiten.Image { x := (int(char) % f.TileSizeX) * f.TileWidth - y := (int(char) / f.TileSizeY) * f.TileHeight + y := (int(char) / f.TileSizeX) * f.TileHeight r := image.Rect(x, y, x+f.TileWidth, y+f.TileHeight)