about summary refs log tree commit diff stats
path: root/src/img
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-07-04 23:26:13 +0200
committerbptato <nincsnevem662@gmail.com>2023-07-04 23:26:13 +0200
commita0ea4c5ac02c750e692a4bbbc3e2d4a6952641e3 (patch)
treed5fbf516531b8ed416576a4f943ccf79ac5175b4 /src/img
parentb15cbe8fc079d34891f7d8553e12ce97e6ecc0c1 (diff)
downloadchawan-a0ea4c5ac02c750e692a4bbbc3e2d4a6952641e3.tar.gz
painter: fix off by one error in getCharBmp
Diffstat (limited to 'src/img')
-rw-r--r--src/img/painter.nim4
1 files changed, 2 insertions, 2 deletions
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: