From ee53b9e601a2f2288826bcd83b6168f7a18881e4 Mon Sep 17 00:00:00 2001 From: Kyzentun Date: Sun, 27 Jul 2014 21:38:43 -0600 Subject: [PATCH] Adjusted text scaling that convert_text_to_indented_lines uses to make it adjust for resolution differences better. --- Themes/_fallback/Scripts/02 Utilities.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Themes/_fallback/Scripts/02 Utilities.lua b/Themes/_fallback/Scripts/02 Utilities.lua index 2d456e770b..cb57430538 100644 --- a/Themes/_fallback/Scripts/02 Utilities.lua +++ b/Themes/_fallback/Scripts/02 Utilities.lua @@ -429,10 +429,12 @@ function convert_text_to_indented_lines(text, indent, width, text_zoom) if sub_lines > 0 then indent_mult= 2 end - local usable_width= width - (indent * indent_mult) - if text:GetWidth() * text_zoom > usable_width * 2 then + -- On larger resolutions, the font can be squished a bit to fit more on a line. + local resolution_width_mult= math.max(1, DISPLAY:GetDisplayHeight() / 720) + local usable_width= (width - (indent * indent_mult)) * resolution_width_mult + if text:GetWidth() * text_zoom > usable_width then clipped= true - width_clip_text(text, usable_width * 2) + width_clip_text(text, usable_width) end indented_lines[#indented_lines+1]= { indent_mult, text:GetText()}