From 06c3c57954bbd6b5cc6ebcdc99f3480c51e45add Mon Sep 17 00:00:00 2001 From: vurtun Date: Fri, 5 Jun 2015 22:55:17 +0200 Subject: [PATCH] fixed opengl font string width calculation --- demo/opengl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/opengl.c b/demo/opengl.c index 9e906ec..76453b5 100644 --- a/demo/opengl.c +++ b/demo/opengl.c @@ -259,7 +259,7 @@ font_get_text_width(gui_handle handle, const gui_char *t, gui_size l) glyph_len = gui_utf_decode(t + text_len, &unicode, l - text_len); text_len += glyph_len; } - return MAX(0, text_width - text_width); + return (l > 1) ? text_width : 0; } static void