From 8f06ef9b8100a0f59aa1fca706dcb84c91316833 Mon Sep 17 00:00:00 2001 From: takase1121 <20792268+takase1121@users.noreply.github.com> Date: Wed, 22 Dec 2021 09:55:47 +0800 Subject: [PATCH] ensure date is rendered properly --- data/core/logview.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/core/logview.lua b/data/core/logview.lua index 18299ac5..99ab0a93 100644 --- a/data/core/logview.lua +++ b/data/core/logview.lua @@ -150,6 +150,8 @@ function LogView:draw() style.icon_font:get_width(style.log.ERROR.icon), style.icon_font:get_width(style.log.INFO.icon) ) + + local tw = style.font:get_width(os.date()) for _, item, x, y, w, h in self:each_item() do core.push_clip_rect(x, y, w, h) x = x + style.padding.x @@ -164,9 +166,8 @@ function LogView:draw() x = x + style.padding.x -- timestamps are always 15% of the width - local tw = w * 15 / 100 local time = os.date(nil, item.time) - common.draw_text(style.font, style.dim, time, "center", x, y, tw, lh) + common.draw_text(style.font, style.dim, time, "left", x, y, tw, lh) x = x + tw + style.padding.x w = w - (x - self:get_content_offset())