diff options
author | crupest <crupest@outlook.com> | 2021-09-15 17:12:51 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-09-15 17:12:51 +0800 |
commit | 105e4ad880a810300bf4b3a0a0752ae58924667b (patch) | |
tree | da9fb12923160312d2d989514b0e4df243907b66 /include/cru/platform/GraphBase.hpp | |
parent | d6cd1c46889e94b325244e5ba5ccea97cc856952 (diff) | |
download | cru-105e4ad880a810300bf4b3a0a0752ae58924667b.tar.gz cru-105e4ad880a810300bf4b3a0a0752ae58924667b.tar.bz2 cru-105e4ad880a810300bf4b3a0a0752ae58924667b.zip |
...
Diffstat (limited to 'include/cru/platform/GraphBase.hpp')
-rw-r--r-- | include/cru/platform/GraphBase.hpp | 18 |
1 files changed, 8 insertions, 10 deletions
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<float>::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) {} |