aboutsummaryrefslogtreecommitdiff
path: root/src/ray.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ray.c')
-rw-r--r--src/ray.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ray.c b/src/ray.c
index 998fe8b..19e96f5 100644
--- a/src/ray.c
+++ b/src/ray.c
@@ -158,6 +158,15 @@ draw_res(void)
win_width = GetScreenWidth();
win_height = GetScreenHeight();
+ font_size = min(win_height/STATE_COUNT, MAX_FONTSIZE/2);
+
+ txt_width = MeasureText("60 + 60 = 120 10000ms", font_size);
+
+ if (txt_width > win_width/2)
+ {
+ float scale = ((float) txt_width)/(win_width/2);
+ font_size = font_size/scale;
+ }
for (int i = 1; i < STATE_COUNT; i++)
{
@@ -181,7 +190,6 @@ draw_res(void)
states[j].x, states[j].y,
states[j].input, states[j].ms);
- font_size = min(win_height/STATE_COUNT, MAX_FONTSIZE/2);
txt_width = MeasureText(txt, font_size);
DrawText(txt, win_width-txt_width,
(int) font_size*1.2*(i-1), font_size, col);