From 5b2461c713889b9832f5b99c85abf87e5d494242 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Mon, 11 Sep 2017 16:25:20 +0200 Subject: Fix core.wrap_text and make its behaviour consistent with the docs Code based on initial implementation by @dsohler. --- builtin/mainmenu/common.lua | 2 +- builtin/mainmenu/tab_mods.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'builtin/mainmenu') 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 9510a9e18..7f95355a9 100644 --- a/builtin/mainmenu/tab_mods.lua +++ b/builtin/mainmenu/tab_mods.lua @@ -75,7 +75,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 = {} -- cgit v1.2.3