From 4b63b35d07ce84269ec4a4e207267c7a93a395dc Mon Sep 17 00:00:00 2001 From: pointer-to-bios Date: Sat, 3 Aug 2024 04:33:40 +0800 Subject: [PATCH] Simplize backgrouds' update. --- src/containers/container.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/containers/container.cpp b/src/containers/container.cpp index 31ddfe4..806da3b 100644 --- a/src/containers/container.cpp +++ b/src/containers/container.cpp @@ -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));