aboutsummaryrefslogtreecommitdiff
path: root/src/ui/render/layout_utility.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-03-03 20:22:36 +0800
committercrupest <crupest@outlook.com>2020-03-03 20:22:36 +0800
commit47053829c322c43032244937cb63f9da178b852d (patch)
treed17b81cdf61b3a48eb978176cfb57dda841da9d1 /src/ui/render/layout_utility.cpp
parentb0946c0e6dc163fe981f230302a1976449150907 (diff)
downloadcru-47053829c322c43032244937cb63f9da178b852d.tar.gz
cru-47053829c322c43032244937cb63f9da178b852d.tar.bz2
cru-47053829c322c43032244937cb63f9da178b852d.zip
Write canvas render object layout logic.
Diffstat (limited to 'src/ui/render/layout_utility.cpp')
-rw-r--r--src/ui/render/layout_utility.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ui/render/layout_utility.cpp b/src/ui/render/layout_utility.cpp
new file mode 100644
index 00000000..aae62d35
--- /dev/null
+++ b/src/ui/render/layout_utility.cpp
@@ -0,0 +1,15 @@
+#include "cru/ui/render/layout_utility.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