summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-12-15 13:50:41 +0100
committerWuzzy <almikes@aol.com>2016-12-15 13:50:41 +0100
commit1da0bb06996a42704b06ae6850c2f5da93114656 (patch)
tree504b2414264ddb7524198b411c23ad8db669cbb0 /init.lua
parentb1e9fc9a5f7bf0585ff862e1aba9fcee2962f4a7 (diff)
Increase text widget line length to 80 again
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/init.lua b/init.lua
index 2758033..919ff27 100644
--- a/init.lua
+++ b/init.lua
@@ -44,6 +44,9 @@ local CATEGORYFIELDSIZE = {
HEIGHT = math.floor(doc.FORMSPEC.HEIGHT-1),
}
+-- Maximum characters per line in the text widget
+local TEXT_LINELENGTH = 80
+
doc.data = {}
doc.data.categories = {}
-- Default order (includes categories of other mods from the Docuentation System modpack)
@@ -422,7 +425,7 @@ doc.entry_builders = {}
-- into spaces
local linebreaker_single = function(text, linelength)
if linelength == nil then
- linelength = 77
+ linelength = TEXT_LINELENGTH
end
local remain = linelength
local res = {}
@@ -518,7 +521,7 @@ doc.widgets.text = function(data, x, y, width, height)
if height == nil then
height = doc.FORMSPEC.ENTRY_HEIGHT
end
- local baselength = 77
+ local baselength = TEXT_LINELENGTH
local widget_basewidth = doc.FORMSPEC.WIDTH
local linelength = math.max(20, math.floor(baselength * (width / widget_basewidth)))