From 6e8d570e3d63b5bc4e24d258d2dd383530ace2a3 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Wed, 26 Nov 2025 22:14:52 +0800 Subject: Clean codes on macos native window. --- include/cru/platform/GraphicsBase.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/cru/platform/GraphicsBase.h b/include/cru/platform/GraphicsBase.h index 89d3df77..dccff4e1 100644 --- a/include/cru/platform/GraphicsBase.h +++ b/include/cru/platform/GraphicsBase.h @@ -155,6 +155,11 @@ struct Rect final { return Rect(left, top, right - left, bottom - top); } + constexpr static Rect FromVertices(const Point& lefttop, + const Point& rightbottom) { + return Rect(lefttop.x, lefttop.y, rightbottom.x - lefttop.x, rightbottom.y - lefttop.y); + } + constexpr static Rect FromCenter(const Point& center, const float width, const float height) { return Rect(center.x - width / 2.0f, center.y - height / 2.0f, width, -- cgit v1.2.3