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.

This commit is contained in:
Kyzentun Keeslala
2015-07-11 20:18:27 -06:00
parent 094f419d0e
commit dc25e2cc1b
+4 -2
View File
@@ -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= {}