From 6388672d007b606f2381f7f72bcc6955457c2977 Mon Sep 17 00:00:00 2001 From: apio Date: Sun, 6 Aug 2023 12:44:35 +0200 Subject: [PATCH] libui: Properly cut off the last drawn character if necessary --- libui/src/Font.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libui/src/Font.cpp b/libui/src/Font.cpp index 36cc3e0c..1c99965c 100644 --- a/libui/src/Font.cpp +++ b/libui/src/Font.cpp @@ -101,7 +101,7 @@ namespace ui { u32 line = offset; int mask = 1 << (m_psf_header.width - 1); - for (int x = 0; x < m_psf_header.width; x++) + for (int x = 0; x < width; x++) { if (*((u32*)glyph) & mask) *(u32*)(canvas.ptr + line) = color.raw; mask >>= 1;