From cc0584f7d12288f1fcad84f4e8ad3f885cfb06f1 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 10 Aug 2019 22:30:02 +0200 Subject: [PATCH] mapeditor:: fixed UI elements crashing into each other --- mapeditor.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mapeditor.cpp b/mapeditor.cpp index 407ee8f6..a790a59f 100644 --- a/mapeditor.cpp +++ b/mapeditor.cpp @@ -666,9 +666,13 @@ namespace mapeditor { } bool choosefile = false; + + int editor_fsize() { + return min(vid.fsize + 5, (vid.yres - 16) /32 ); + } void displayFunctionKeys() { - int fs = min(vid.fsize + 5, vid.yres/26); + int fs = editor_fsize(); displayButton(8, vid.yres-8-fs*11, XLAT("F1 = help"), SDLK_F1, 0); displayButton(8, vid.yres-8-fs*10, XLAT("F2 = save"), SDLK_F2, 0); displayButton(8, vid.yres-8-fs*9, XLAT("F3 = load"), SDLK_F3, 0); @@ -685,7 +689,7 @@ namespace mapeditor { cmode = sm::MAP; gamescreen(0); - int fs = min(vid.fsize + 5, vid.yres/26); + int fs = editor_fsize(); getcstat = '-'; @@ -1309,7 +1313,7 @@ namespace mapeditor { us =usershapes[drawcellShapeGroup()][drawcellShapeID()]; } - int fs = min(vid.fsize + 5, vid.yres/28); + int fs = editor_fsize(); // displayButton(8, 8+fs*9, XLAT("l = lands"), 'l', 0); displayfr(8, 8+fs, 2, vid.fsize, line1, 0xC0C0C0, 0);