aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-09-29 20:45:36 +0800
committercrupest <crupest@outlook.com>2021-09-29 20:45:36 +0800
commitf246877698e5b9aa98e99f3fd3d2247998008695 (patch)
tree7239563128f1d78d7537ac98c85b41ce1e2f85a7 /include/cru/platform
parent0338eb4f547f8eebe8c838c0794ec935db3cf0d8 (diff)
downloadcru-f246877698e5b9aa98e99f3fd3d2247998008695.tar.gz
cru-f246877698e5b9aa98e99f3fd3d2247998008695.tar.bz2
cru-f246877698e5b9aa98e99f3fd3d2247998008695.zip
...
Diffstat (limited to 'include/cru/platform')
-rw-r--r--include/cru/platform/GraphicsBase.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/cru/platform/GraphicsBase.hpp b/include/cru/platform/GraphicsBase.hpp
index e7201ec0..aee718a1 100644
--- a/include/cru/platform/GraphicsBase.hpp
+++ b/include/cru/platform/GraphicsBase.hpp
@@ -182,6 +182,11 @@ struct Rect final {
return Point(left + width / 2.0f, top + height / 2.0f);
}
+ constexpr void SetSize(const Size& size) {
+ width = size.width;
+ height = size.height;
+ }
+
constexpr Size GetSize() const { return Size(width, height); }
constexpr Rect Expand(const Thickness& thickness) const {