diff --git a/include/SFML/Window/Window.hpp b/include/SFML/Window/Window.hpp index 21bb2c55..89ebc937 100644 --- a/include/SFML/Window/Window.hpp +++ b/include/SFML/Window/Window.hpp @@ -274,7 +274,7 @@ public : /// \see getSize /// //////////////////////////////////////////////////////////// - void setSize(const Vector2u size); + void setSize(const Vector2u& size); //////////////////////////////////////////////////////////// /// \brief Change the title of the window diff --git a/src/SFML/Window/Window.cpp b/src/SFML/Window/Window.cpp index 0970c986..658c7ff4 100644 --- a/src/SFML/Window/Window.cpp +++ b/src/SFML/Window/Window.cpp @@ -231,10 +231,19 @@ Vector2u Window::getSize() const //////////////////////////////////////////////////////////// -void Window::setSize(const Vector2u size) +void Window::setSize(const Vector2u& size) { if (m_impl) + { m_impl->setSize(size); + + // Cache the new size + m_size.x = size.x; + m_size.y = size.y; + + // Notify the derived class + onResize(); + } }