fix bug that widgets may not draw correctly

This commit is contained in:
Jinhao 2018-07-02 05:42:56 +08:00
parent 40a6584a75
commit 5a4edd2fef

View File

@ -950,6 +950,19 @@ namespace detail
if (wd->dimension == sz)
return false;
std::vector<core_window_t*> presence;
if (wd->dimension.width < sz.width || wd->dimension.height < sz.height)
{
auto wd_r = rectangle{ wd->dimension };
for (auto child : wd->children)
{
auto child_r = rectangle{ child->pos_owner, child->dimension };
if (!overlapped(wd_r, child_r))
presence.push_back(child);
}
}
//Before resiz the window, creates the new graphics
paint::graphics graph;
paint::graphics root_graph;
@ -1010,6 +1023,11 @@ namespace detail
}
}
for (auto child : presence)
{
refresh_tree(child);
}
arg_resized arg;
arg.window_handle = reinterpret_cast<window>(wd);
arg.width = sz.width;