Refactor XCUI editor module layout
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include <XCEditor/Widgets/UIEditorFieldRowLayout.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
namespace XCEngine::UI::Editor::Widgets {
|
||||
|
||||
@@ -10,8 +11,30 @@ float ClampNonNegative(float value) {
|
||||
return (std::max)(0.0f, value);
|
||||
}
|
||||
|
||||
bool AreEqual(float lhs, float rhs) {
|
||||
return std::abs(lhs - rhs) <= 0.001f;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
const UIEditorInspectorFieldStyleTokens& GetUIEditorInspectorFieldStyleTokens() {
|
||||
static const UIEditorInspectorFieldStyleTokens kTokens = {};
|
||||
return kTokens;
|
||||
}
|
||||
|
||||
bool AreUIEditorFieldMetricsEqual(float lhs, float rhs) {
|
||||
return AreEqual(lhs, rhs);
|
||||
}
|
||||
|
||||
bool AreUIEditorFieldColorsEqual(
|
||||
const ::XCEngine::UI::UIColor& lhs,
|
||||
const ::XCEngine::UI::UIColor& rhs) {
|
||||
return AreEqual(lhs.r, rhs.r) &&
|
||||
AreEqual(lhs.g, rhs.g) &&
|
||||
AreEqual(lhs.b, rhs.b) &&
|
||||
AreEqual(lhs.a, rhs.a);
|
||||
}
|
||||
|
||||
UIEditorFieldRowLayout BuildUIEditorFieldRowLayout(
|
||||
const ::XCEngine::UI::UIRect& bounds,
|
||||
float minimumControlWidth,
|
||||
|
||||
Reference in New Issue
Block a user