mirror of
https://github.com/koreader/koreader
synced 2024-11-10 01:10:34 +00:00
TextWidget: allow numbers in setText and updateSize (#12310)
Closes #12318.
This commit is contained in:
parent
92de5821bb
commit
dc3b638378
@ -178,8 +178,8 @@ function TextWidget:updateSize()
|
||||
end
|
||||
dbg:guard(TextWidget, "updateSize",
|
||||
function(self)
|
||||
assert(type(self.text) == "string",
|
||||
"Wrong text type (expected string)")
|
||||
assert(type(self.text) == "string" or type(self.text) == "number",
|
||||
"Wrong self.text type (expected string or number)")
|
||||
end)
|
||||
|
||||
function TextWidget:_measureWithXText()
|
||||
@ -324,8 +324,8 @@ function TextWidget:setText(text)
|
||||
end
|
||||
dbg:guard(TextWidget, "setText",
|
||||
function(self, text)
|
||||
assert(type(text) == "string",
|
||||
"Wrong text type (expected string)")
|
||||
assert(type(text) == "string" or type(text) == "number",
|
||||
"Wrong text type (expected string or number)")
|
||||
end)
|
||||
|
||||
function TextWidget:setMaxWidth(max_width)
|
||||
|
Loading…
Reference in New Issue
Block a user