aboutsummaryrefslogtreecommitdiff
path: root/plugins/bigclock.lua
diff options
context:
space:
mode:
authorrxi <rxi@users.noreply.github.com>2020-05-24 14:56:36 +0100
committerrxi <rxi@users.noreply.github.com>2020-05-24 14:56:36 +0100
commita6056db6510565af2d04b95af486fe033ab7376a (patch)
treed36f349ad710b01d8f86378b175e872978a6dce2 /plugins/bigclock.lua
parentf44dcbb87123a87dbfff3f734fc338f0865daf69 (diff)
downloadlite-xl-plugins-a6056db6510565af2d04b95af486fe033ab7376a.tar.gz
lite-xl-plugins-a6056db6510565af2d04b95af486fe033ab7376a.zip
Reduced memory usage on `bigclock` plugin
Diffstat (limited to 'plugins/bigclock.lua')
-rw-r--r--plugins/bigclock.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/bigclock.lua b/plugins/bigclock.lua
index 67d62e2..e35cdbe 100644
--- a/plugins/bigclock.lua
+++ b/plugins/bigclock.lua
@@ -27,11 +27,12 @@ end
function ClockView:update_fonts()
- local size = math.floor(self.size.x * 0.15) * config.bigclock_scale
+ local size = math.floor(self.size.x * 0.15 / 15) * 15 * config.bigclock_scale
if self.font_size ~= size then
self.time_font = renderer.font.load(EXEDIR .. "/data/fonts/font.ttf", size)
self.date_font = renderer.font.load(EXEDIR .. "/data/fonts/font.ttf", size * 0.3)
self.font_size = size
+ collectgarbage()
end
return self.font
end