mirror of
https://github.com/minetest-mods/digilines.git
synced 2024-09-26 05:40:26 +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 line_num = 1
|
||||||
local tab = {}
|
local tab = {}
|
||||||
for word in string.gmatch(text, "%S*") do
|
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
|
if line ~= "" then
|
||||||
line = line.." "..word
|
line = line.." "..word
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user