fix rect.resize

This commit is contained in:
ruki
2020-05-07 22:44:16 +08:00
parent f898c452f3
commit d0ebc6a542
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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