diff options
| author | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-06-28 14:13:24 +0900 | 
|---|---|---|
| committer | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-06-28 14:13:24 +0900 | 
| commit | 1ebb0f1a135af6febab5aefbf9247a08c90f33d1 (patch) | |
| tree | 5aab909aabf6497d200d425246d3205a4b8b6881 | |
| parent | bbff771d70698a148267d3e510b33858879ea8d0 (diff) | |
Fix the drawing of results
| -rw-r--r-- | src/ray.c | 12 | 
1 files changed, 9 insertions, 3 deletions
| @@ -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);  	}  } | 
