From 105e4ad880a810300bf4b3a0a0752ae58924667b Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 15 Sep 2021 17:12:51 +0800 Subject: ... --- include/cru/platform/GraphBase.hpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'include/cru/platform/GraphBase.hpp') diff --git a/include/cru/platform/GraphBase.hpp b/include/cru/platform/GraphBase.hpp index 2cfc9cc4..e7201ec0 100644 --- a/include/cru/platform/GraphBase.hpp +++ b/include/cru/platform/GraphBase.hpp @@ -1,8 +1,6 @@ #pragma once #include "cru/common/Base.hpp" -#include "Color.hpp" -#include "cru/common/Format.hpp" #include "cru/common/Range.hpp" #include "cru/common/String.hpp" @@ -20,10 +18,6 @@ struct Point final { constexpr Point(const float x, const float y) : x(x), y(y) {} explicit constexpr Point(const Size& size); - String ToDebugString() const { - return Format(u"({}, {})", ToUtf16String(x), ToUtf16String(y)); - } - constexpr Point& operator+=(const Point& other) { this->x += other.x; this->y += other.y; @@ -50,6 +44,10 @@ constexpr bool operator!=(const Point& left, const Point& right) { return !(left == right); } +inline String ToString(const Point& point) { + return Format(u"(x: {}, y: {})", point.x, point.y); +} + struct Size final { constexpr Size() = default; constexpr Size(const float width, const float height) @@ -62,10 +60,6 @@ struct Size final { std::numeric_limits::max()}; } - String ToDebugString() const { - return Format(u"({}, {})", ToUtf16String(width), ToUtf16String(height)); - } - float width = 0; float height = 0; }; @@ -88,6 +82,10 @@ constexpr bool operator!=(const Size& left, const Size& right) { return !(left == right); } +inline String ToString(const Size& size) { + return Format(u"(width: {}, height: {})", size.width, size.height); +} + struct Thickness final { constexpr Thickness() : Thickness(0) {} -- cgit v1.2.3