From: Holger Schemel Date: Sun, 6 Oct 2024 09:28:07 +0000 (+0200) Subject: added wrapping element token text in level editor, if needed X-Git-Tag: 4.4.0.0-test-4~152 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=d127bcdef077cb34da3cf5cc1d2252dc37198d18;p=rocksndiamonds.git added wrapping element token text in level editor, if needed --- diff --git a/src/editor.c b/src/editor.c index d505f325..edad7c55 100644 --- a/src/editor.c +++ b/src/editor.c @@ -12337,10 +12337,11 @@ static void DrawPropertiesInfo(void) int font3_nr = FONT_TEXT_3; int font3_height = getFontHeight(font3_nr); - DrawTextF(xpos, ypos, font3_nr, - "[%s]", element_info[properties_element].token_name); + // wrap element token text if it is longer than window width + char *text_token = getStringPrint("[%s]", element_info[properties_element].token_name); + int num_lines = PrintTextFromBuffer(text_token, font3_nr, xpos, ypos); - ypos += 2 * font3_height; + ypos += (num_lines + 1) * font3_height; } // ----- print number of elements / percentage of this element in level