From a0ea4c5ac02c750e692a4bbbc3e2d4a6952641e3 Mon Sep 17 00:00:00 2001 From: bptato Date: Tue, 4 Jul 2023 23:26:13 +0200 Subject: painter: fix off by one error in getCharBmp --- src/img/painter.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/img') diff --git a/src/img/painter.nim b/src/img/painter.nim index 8296b744..d52aaff1 100644 --- a/src/img/painter.nim +++ b/src/img/painter.nim @@ -152,8 +152,8 @@ proc getCharBmp(u: uint32): Bitmap = if cu == u: return bmp # Unifont glyphs start at x: 32, y: 64, and are of 8x16/16x16 size - let gx = uint64(32 + 16 * (u mod 0xFF)) - let gy = uint64(64 + 16 * (u div 0xFF)) + let gx = uint64(32 + 16 * (u mod 0x100)) + let gy = uint64(64 + 16 * (u div 0x100)) var fullwidth = false const white = rgba(255, 255, 255, 255) block loop: -- cgit 1.4.1-2-gfad0