From 132dcb648981050990e34a44925e6b54d0dc008c Mon Sep 17 00:00:00 2001 From: Leo Tenenbaum Date: Wed, 6 Jan 2021 17:36:07 -0500 Subject: more open menu, border thickness setting, fixed small text clipping issue --- text.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'text.c') diff --git a/text.c b/text.c index 3044ecb..09b5778 100644 --- a/text.c +++ b/text.c @@ -210,8 +210,8 @@ void text_render_char(Font *font, TextRenderState *state, char32_t c) { } if (x1 >= max_x) { // right side of character is clipped - s1 = (max_x-x0) / (x1-x0) * (s1-s0) + s0; - x1 = max_x; + s1 = (max_x-1-x0) / (x1-x0) * (s1-s0) + s0; + x1 = max_x-1; } if (y0 < min_y) { // top side of character is clipped @@ -220,8 +220,8 @@ void text_render_char(Font *font, TextRenderState *state, char32_t c) { } if (y1 >= max_y) { // bottom side of character is clipped - t1 = (max_y-y0) / (y1-y0) * (t1-t0) + t0; - y1 = max_y; + t1 = (max_y-1-y0) / (y1-y0) * (t1-t0) + t0; + y1 = max_y-1; } glTexCoord2f(s0,t0); glVertex2f(x0,y0); glTexCoord2f(s0,t1); glVertex2f(x0,y1); -- cgit v1.2.3