diff options
Diffstat (limited to 'advtrains/textrender.lua')
-rw-r--r-- | advtrains/textrender.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/advtrains/textrender.lua b/advtrains/textrender.lua index acba0d8..2f8f18b 100644 --- a/advtrains/textrender.lua +++ b/advtrains/textrender.lua @@ -199,7 +199,7 @@ local function split_into_segments(cs) if not sl[1] then sl[1] = {width = cwidth, seq = {char}, size = {cwidth}} else - seg = sl[#sl] + local seg = sl[#sl] local seq, size = seg.seq, seg.size seq[#seq+1] = char size[#size+1] = (size[#size] or 0) + cwidth @@ -330,7 +330,7 @@ local function check_options(width, height, options) -- check "wrap overflow text segment" option ret.wrap_overflow = opt.wrap_overflow and true or false -- convert to boolean -- check line count option - local maxlines = math.max(h/18) + local maxlines = math.floor(h/18) ret.lines = math.min(maxlines, tonumber(opt.lines) or maxlines) -- check text color option ret.color = string.match(tostring(options.color) or "", "^#%x%x%x%x%x%x$") or "#000000" |