From ce09e4910ed02c62e07748ba2c4fc955d24483af Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 27 May 2024 15:54:12 +0200 Subject: [PATCH] display smaller mouseover help if there is too much text --- graph.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/graph.cpp b/graph.cpp index 955b5231..fb3d184e 100644 --- a/graph.cpp +++ b/graph.cpp @@ -5933,8 +5933,12 @@ EX void drawscreen() { color_t col = linf[cwt.at->land].color; if(cwt.at->land == laRedRock) col = 0xC00000; if(titlecolor) col = titlecolor; - if(nohelp != 1) - displayfr(vid.xres/2, vid.fsize, 2, vid.fsize, mouseovers, col, 8); + if(nohelp != 1) { + int size = vid.fsize; + while(size > 3 && textwidth(size, mouseovers) > vid.xres) size--; + println(hlog, "mouseovers size changed from ", vid.fsize, " to ", size); + displayfr(vid.xres/2, vid.fsize, 2, size, mouseovers, col, 8); + } #endif drawmessages();