mirror of
https://github.com/minetest-mods/digilines.git
synced 2024-09-27 22:30:22 +02:00
if a words fits the screen width exactly, don't put it on the next line
This commit is contained in:
parent
3c0900c115
commit
98349028eb
2
lcd.lua
2
lcd.lua
|
@ -35,7 +35,7 @@ local create_lines = function(text)
|
|||
local line_num = 1
|
||||
local tab = {}
|
||||
for word in string.gmatch(text, "%S*") do
|
||||
if string.len(line)+string.len(word) < LINE_LENGTH and word ~= "|" then
|
||||
if (string.len(line) and string.len(line)+1) + string.len(word) <= LINE_LENGTH and word ~= "|" then
|
||||
if line ~= "" then
|
||||
line = line.." "..word
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue
Block a user