From 1ebb0f1a135af6febab5aefbf9247a08c90f33d1 Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Fri, 28 Jun 2024 14:13:24 +0900 Subject: Fix the drawing of results --- src/ray.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ray.c b/src/ray.c index 402d600..998fe8b 100644 --- a/src/ray.c +++ b/src/ray.c @@ -161,7 +161,13 @@ draw_res(void) for (int i = 1; i < STATE_COUNT; i++) { - int j = (current_state - i)%STATE_COUNT; + int j = current_state - i; + + if (j < 0) + j += STATE_COUNT; + + TraceLog(LOG_DEBUG, "i = %d", i); + TraceLog(LOG_DEBUG, "j = %d", j); if (states[j].ms == 0) break; @@ -177,8 +183,8 @@ draw_res(void) font_size = min(win_height/STATE_COUNT, MAX_FONTSIZE/2); txt_width = MeasureText(txt, font_size); - /* TODO: draw every results */ - DrawText(txt, win_width-txt_width, (int) font_size*1.2*i, font_size, col); + DrawText(txt, win_width-txt_width, + (int) font_size*1.2*(i-1), font_size, col); } } -- cgit v1.2.3