aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/render/MeasureRequirement.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/ui/render/MeasureRequirement.h')
-rw-r--r--include/cru/ui/render/MeasureRequirement.h22
1 files changed, 7 insertions, 15 deletions
diff --git a/include/cru/ui/render/MeasureRequirement.h b/include/cru/ui/render/MeasureRequirement.h
index 544e0788..43bd3326 100644
--- a/include/cru/ui/render/MeasureRequirement.h
+++ b/include/cru/ui/render/MeasureRequirement.h
@@ -1,8 +1,6 @@
#pragma once
#include "../Base.h"
-#include "cru/base/String.h"
-
#include <algorithm>
#include <format>
#include <limits>
@@ -113,13 +111,11 @@ class MeasureLength final {
}
}
- std::string ToDebugStringUtf8() const {
+ std::string ToDebugString() const {
return IsSpecified() ? std::to_string(GetLengthOrUndefined())
: "UNSPECIFIED";
}
- String ToDebugString() const { return String::FromUtf8(ToDebugStringUtf8()); }
-
private:
// -1 for not specify
float length_;
@@ -168,13 +164,11 @@ struct MeasureSize {
};
}
- std::string ToDebugStringUtf8() const {
- return std::format("({}, {})", width.ToDebugStringUtf8(),
- height.ToDebugStringUtf8());
+ std::string ToDebugString() const {
+ return std::format("({}, {})", width.ToDebugString(),
+ height.ToDebugString());
}
- String ToDebugString() const { return String::FromUtf8(ToDebugStringUtf8()); }
-
constexpr static MeasureSize NotSpecified() {
return MeasureSize{MeasureLength::NotSpecified(),
MeasureLength::NotSpecified()};
@@ -241,13 +235,11 @@ struct MeasureRequirement {
return result;
}
- std::string ToDebugStringUtf8() const {
- return std::format("{{min: {}, max: {}}}", min.ToDebugStringUtf8(),
- max.ToDebugStringUtf8());
+ std::string ToDebugString() const {
+ return std::format("{{min: {}, max: {}}}", min.ToDebugString(),
+ max.ToDebugString());
}
- String ToDebugString() const { return String::FromUtf8(ToDebugStringUtf8()); }
-
constexpr static MeasureRequirement Merge(const MeasureRequirement& left,
const MeasureRequirement& right) {
return MeasureRequirement{MeasureSize::Min(left.max, right.max),