From 6aa9d9b79b0b862f9ea38ded5b9bec51383e95b0 Mon Sep 17 00:00:00 2001 From: Rahix <rahix@rahix.de> Date: Wed, 14 Aug 2019 10:03:06 +0200 Subject: [PATCH] fix(gfx): Fix text being offset by one character Text was displayed one character further right than intended because the offset was incremented before drawing. This commit reverses the two operations and thus restores proper display of text. Signed-off-by: Rahix <rahix@rahix.de> --- lib/gfx/gfx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/gfx/gfx.c b/lib/gfx/gfx.c index 4bc9f35d..e26ca9c1 100644 --- a/lib/gfx/gfx.c +++ b/lib/gfx/gfx.c @@ -87,6 +87,9 @@ void gfx_puts( Color bg ) { while (*str) { + gfx_putchar(font, r, x, y, *str, fg, bg); + str++; + x += font->Width; if (x >= r->width) { x = 0; @@ -94,8 +97,6 @@ void gfx_puts( } if (y >= r->height) return; - gfx_putchar(font, r, x, y, *str, fg, bg); - str++; } } -- GitLab