diff options
author | crupest <crupest@outlook.com> | 2020-05-24 01:40:02 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-05-24 01:40:02 +0800 |
commit | d86a71f79afe0e4dac768f61d6bff690567aca5b (patch) | |
tree | 4957e9a64c77680deb07201fbd879bf036616dae /src/ui/render/LayoutUtility.cpp | |
parent | f3a8fd608a9776ef0a5f547da918a32cf6074060 (diff) | |
download | cru-d86a71f79afe0e4dac768f61d6bff690567aca5b.tar.gz cru-d86a71f79afe0e4dac768f61d6bff690567aca5b.tar.bz2 cru-d86a71f79afe0e4dac768f61d6bff690567aca5b.zip |
...
Diffstat (limited to 'src/ui/render/LayoutUtility.cpp')
-rw-r--r-- | src/ui/render/LayoutUtility.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ui/render/LayoutUtility.cpp b/src/ui/render/LayoutUtility.cpp new file mode 100644 index 00000000..03252f1c --- /dev/null +++ b/src/ui/render/LayoutUtility.cpp @@ -0,0 +1,15 @@ +#include "cru/ui/render/LayoutUtility.hpp" + +#include <algorithm> + +namespace cru::ui::render { +Size Min(const Size& left, const Size& right) { + return Size{std::min(left.width, right.width), + std::min(left.height, right.height)}; +} + +Size Max(const Size& left, const Size& right) { + return Size{std::max(left.width, right.width), + std::max(left.height, right.height)}; +} +} // namespace cru::ui::render |