Simplize backgrouds' update.

This commit is contained in:
pointer-to-bios 2024-08-03 04:33:40 +08:00
parent 442b7d065b
commit 4b63b35d07
1 changed files with 5 additions and 0 deletions

View File

@ -144,6 +144,11 @@ bool Container::hasInternalChange() const
void Container::update() const
{
auto &window = getRoot()->windowSFWindow();
if (isRoot())
{
window.clear(backgroudColor);
return;
}
window.setView(view);
sf::RectangleShape bg(vec(size.x, size.y));
bg.setPosition(vec(0.f, 0.f));