diff options
author | sfan5 <sfan5@live.de> | 2017-09-11 16:25:20 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2017-09-12 19:33:00 +0200 |
commit | 6fa2f6b4aa42683fc85a6ce4a2a03a4b47c36974 (patch) | |
tree | 3694bada19cc38cc32a5616f7db4e9b0207b3a53 /builtin/mainmenu | |
parent | 17fd5fe9358615633a04d7a3941b444a8ce5f199 (diff) | |
download | minetest-6fa2f6b4aa42683fc85a6ce4a2a03a4b47c36974.tar.gz minetest-6fa2f6b4aa42683fc85a6ce4a2a03a4b47c36974.tar.bz2 minetest-6fa2f6b4aa42683fc85a6ce4a2a03a4b47c36974.zip |
Fix core.wrap_text and make its behaviour consistent with the docs
Code based on initial implementation by @dsohler.
Diffstat (limited to 'builtin/mainmenu')
-rw-r--r-- | builtin/mainmenu/common.lua | 2 | ||||
-rw-r--r-- | builtin/mainmenu/tab_mods.lua | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/builtin/mainmenu/common.lua b/builtin/mainmenu/common.lua index fa7ae583b..7eb941775 100644 --- a/builtin/mainmenu/common.lua +++ b/builtin/mainmenu/common.lua @@ -250,7 +250,7 @@ end -------------------------------------------------------------------------------- function text2textlist(xpos, ypos, width, height, tl_name, textlen, text, transparency) - local textlines = core.wrap_text(text, textlen) + local textlines = core.wrap_text(text, textlen, true) local retval = "textlist[" .. xpos .. "," .. ypos .. ";" .. width .. "," .. height .. ";" .. tl_name .. ";" diff --git a/builtin/mainmenu/tab_mods.lua b/builtin/mainmenu/tab_mods.lua index d829c2cce..e74fb442c 100644 --- a/builtin/mainmenu/tab_mods.lua +++ b/builtin/mainmenu/tab_mods.lua @@ -66,7 +66,7 @@ local function get_formspec(tabview, name, tabdata) if error == nil then local descriptiontext = descriptionfile:read("*all") - descriptionlines = core.wrap_text(descriptiontext, 42) + descriptionlines = core.wrap_text(descriptiontext, 42, true) descriptionfile:close() else descriptionlines = {} |