From dc25e2cc1b4262e94a8670ae73f101dfe2bbb5ea Mon Sep 17 00:00:00 2001 From: Kyzentun Keeslala Date: Sat, 11 Jul 2015 20:18:27 -0600 Subject: [PATCH] Fixed bug in LogDisplay that made it put actors at non-integer indices and not work if the screen height was not a multiple of the line height. --- Themes/_fallback/Scripts/04 LogDisplay.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Themes/_fallback/Scripts/04 LogDisplay.lua b/Themes/_fallback/Scripts/04 LogDisplay.lua index 2226d7e6bb..5a68e68a2f 100644 --- a/Themes/_fallback/Scripts/04 LogDisplay.lua +++ b/Themes/_fallback/Scripts/04 LogDisplay.lua @@ -106,7 +106,9 @@ local log_display_mt= { self.line_width= params.LineWidth or SCREEN_WIDTH self.text_zoom= params.TextZoom or .5 self.text_color= params.TextColor or color("#93a1a1") - self.max_lines= params.MaxLines or SCREEN_HEIGHT / self.line_height + local lines_on_screen= params.MaxLines or SCREEN_HEIGHT / self.line_height + self.max_lines= math.floor(lines_on_screen) + self.add_to_height= (lines_on_screen - self.max_lines) * self.line_height self.max_log= params.MaxLogLen or self.max_lines self.indent= params.Indent or 8 self.times= params.Times @@ -120,7 +122,7 @@ local log_display_mt= { subself:visible(true) subself:linear(params.Times.hide) local cover= math.min(self.line_height * (lines+.5), SCREEN_HEIGHT) - subself:y(-SCREEN_HEIGHT + cover) + subself:y(-SCREEN_HEIGHT + cover + self.add_to_height) end self.text_actors= {}