Adjusted text scaling that convert_text_to_indented_lines uses to make it adjust for resolution differences better.

This commit is contained in:
Kyzentun
2014-07-27 21:38:43 -06:00
committed by Jonathan Payne
parent 9339f5dfb8
commit b882f3506a
+5 -3
View File
@@ -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()}