diff --git a/src/ltui/rect.lua b/src/ltui/rect.lua index 67c0b75..56a2df1 100644 --- a/src/ltui/rect.lua +++ b/src/ltui/rect.lua @@ -52,7 +52,7 @@ function rect:height() end -- resize rect -function rect:on_resize(w, h) +function rect:resize(w, h) self.ex = self.sx + w self.ey = self.sy + h end diff --git a/src/ltui/window.lua b/src/ltui/window.lua index 3df7801..761a9df 100644 --- a/src/ltui/window.lua +++ b/src/ltui/window.lua @@ -59,7 +59,7 @@ function window:init(name, bounds, title, shadow) self:title():action_set(action.ac_on_text_changed, function (v) if v:text() then local bounds = v:bounds() - v:bounds():on_resize(#v:text(), v:height()) + v:bounds():resize(#v:text(), v:height()) bounds:move2(math.max(0, math.floor((self:frame():width() - v:width()) / 2)), bounds.sy) v:invalidate(true) end