diff --git a/src/common/rectangle.h b/src/common/rectangle.h index c7369e57e..bd2689569 100644 --- a/src/common/rectangle.h +++ b/src/common/rectangle.h @@ -3,6 +3,7 @@ #include #include #include +#include namespace Common { @@ -63,10 +64,7 @@ struct Rectangle /// Assignment operator. constexpr Rectangle& operator=(const Rectangle& rhs) { - left = rhs.left; - top = rhs.top; - right = rhs.right; - bottom = rhs.bottom; + std::memcpy(this, &rhs, sizeof(Rectangle)); return *this; } @@ -193,4 +191,4 @@ struct Rectangle T bottom; }; -} // namespace Common \ No newline at end of file +} // namespace Common