From 1440f35fa62fd2c01b4844261290c88e42d2430f Mon Sep 17 00:00:00 2001 From: Niklp <89982526+Niklp09@users.noreply.github.com> Date: Mon, 24 Jul 2023 09:59:26 +0200 Subject: Add luacheck, update translations, replace ABMs, bug fixes (#1) * luacheck, mt 5 translation, german translation, maintenance * fix luacheck warnings * Fix digital clock nodebox and texture * Fix luacheck usage * Add comment why fonts are not split into several lines --- font_api/font.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'font_api/font.lua') diff --git a/font_api/font.lua b/font_api/font.lua index 5794867..d7b67d7 100644 --- a/font_api/font.lua +++ b/font_api/font.lua @@ -212,7 +212,7 @@ end -- @return Texture string function Font:render(text, texturew, textureh, style) - local style = style or {} + style = style or {} -- Split text into lines (and limit to style.lines # of lines) local lines = {} @@ -243,17 +243,17 @@ function Font:render(text, texturew, textureh, style) y = y + (self.margintop or 0) - for _, line in pairs(lines) do + for _, l in pairs(lines) do if style.halign == "left" then x = 0 elseif style.halign == "right" then - x = texturew - line.width + x = texturew - l.width else - x = (texturew - line.width) / 2 + x = (texturew - l.width) / 2 end - while line.text ~= '' do - codepoint, line.text = self:get_next_char(line.text) + while l.text ~= '' do + codepoint, l.text = self:get_next_char(l.text) if codepoint == nil then return '' end -- UTF Error -- Add image only if it is visible (at least partly) -- cgit v1.2.3