Adjusted text scaling that convert_text_to_indented_lines uses to make it adjust for resolution differences better.
This commit is contained in:
@@ -429,10 +429,12 @@ function convert_text_to_indented_lines(text, indent, width, text_zoom)
|
|||||||
if sub_lines > 0 then
|
if sub_lines > 0 then
|
||||||
indent_mult= 2
|
indent_mult= 2
|
||||||
end
|
end
|
||||||
local usable_width= width - (indent * indent_mult)
|
-- On larger resolutions, the font can be squished a bit to fit more on a line.
|
||||||
if text:GetWidth() * text_zoom > usable_width * 2 then
|
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
|
clipped= true
|
||||||
width_clip_text(text, usable_width * 2)
|
width_clip_text(text, usable_width)
|
||||||
end
|
end
|
||||||
indented_lines[#indented_lines+1]= {
|
indented_lines[#indented_lines+1]= {
|
||||||
indent_mult, text:GetText()}
|
indent_mult, text:GetText()}
|
||||||
|
|||||||
Reference in New Issue
Block a user