aboutsummaryrefslogtreecommitdiff
path: root/src/SearchBar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/SearchBar.cpp')
-rw-r--r--src/SearchBar.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/SearchBar.cpp b/src/SearchBar.cpp
index 6aa6eec..059d028 100644
--- a/src/SearchBar.cpp
+++ b/src/SearchBar.cpp
@@ -55,11 +55,17 @@ namespace QuickMedia {
}
void SearchBar::draw(sf::RenderWindow &window, bool draw_shadow) {
+ sf::Vector2u window_size = window.getSize();
+ if(window_size.x != prev_window_size.x || window_size.y != prev_window_size.y) {
+ needs_update = true;
+ prev_window_size = window_size;
+ }
+
if(needs_update) {
needs_update = false;
- sf::Vector2u window_size = window.getSize();
onWindowResize(sf::Vector2f(window_size.x, window_size.y));
}
+
(void)draw_shadow;
//if(draw_shadow)
// window.draw(background_shadow);