From 2e300a17250c2e391cd36d5743b806877982eaf2 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 19 Jan 2018 22:47:14 +0800 Subject: fix refresh bug --- tests/ui/dialog.lua | 4 +--- xmake/core/ui/panel.lua | 2 +- xmake/core/ui/view.lua | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/ui/dialog.lua b/tests/ui/dialog.lua index 9e4d601c1..827ca1385 100644 --- a/tests/ui/dialog.lua +++ b/tests/ui/dialog.lua @@ -77,9 +77,7 @@ function demo:init() dialog_input:show(false) end) self:insert(dialog_input, {centerx = true, centery = true}) - - -- TODO --- dialog_input:show(false) + dialog_input:show(false) end -- main entry diff --git a/xmake/core/ui/panel.lua b/xmake/core/ui/panel.lua index 8cacefc90..fac72a2ab 100644 --- a/xmake/core/ui/panel.lua +++ b/xmake/core/ui/panel.lua @@ -321,7 +321,7 @@ end function panel:refresh() -- need not refresh? do not refresh it - if not self:state("refresh") then + if not self:state("refresh") or not self:state("visible") then return end diff --git a/xmake/core/ui/view.lua b/xmake/core/ui/view.lua index 471a42b60..8c3cabaee 100644 --- a/xmake/core/ui/view.lua +++ b/xmake/core/ui/view.lua @@ -193,7 +193,7 @@ function view:refresh() -- refresh to the parent view local parent = self:parent() - if parent then + if parent and self:state("visible") then -- clip bounds with the parent view local bounds = self:bounds() -- cgit v1.3.1