mirror of https://github.com/teverse/teverse
Fixed error and on cleared set canvasOffset correctly.
This commit is contained in:
parent
c402087972
commit
3e509c10ec
core/teverseUI
|
@ -48,14 +48,16 @@ end)
|
|||
--If the code fails, print it out.
|
||||
textBox:on("keyDown", function(key)
|
||||
if key == "KEY_RETURN" or key == "KEY_KP_ENTER" then
|
||||
local _, errorMessage = pcall(loadstring(textBox.text))
|
||||
if errorMessage then
|
||||
_, errorMessage = pcall(loadstring("return "..textBox.text))
|
||||
if errorMessage then
|
||||
print("CONSOLE ERROR: "..errorMessage)
|
||||
local success, valueReturned = pcall(loadstring(textBox.text))
|
||||
if not success then
|
||||
success, valueReturned = pcall(loadstring("return "..textBox.text))
|
||||
if not success then
|
||||
print("CONSOLE ERROR: "..valueReturned)
|
||||
else
|
||||
print(function2())
|
||||
print(valueReturned or "Ran without error.")
|
||||
end
|
||||
else
|
||||
print(valueReturned or "Ran without error.")
|
||||
end
|
||||
textBox.text = ""
|
||||
end
|
||||
|
|
|
@ -80,6 +80,7 @@ local new = function(properties)
|
|||
list = {}
|
||||
viewScroll:destroyChildren()
|
||||
interface.reload()
|
||||
viewScroll.canvasOffset = vector2()
|
||||
end
|
||||
|
||||
viewScroll:on("changed", function(changed)
|
||||
|
|
Loading…
Reference in New Issue