From 681bc5cc2519446a81f68b76115bfabdad521f89 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Sat, 5 Feb 2022 20:44:13 +0300 Subject: [PATCH] Fix ui frame_impl size constraints --- libs/ui/source/default_element_factory.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/ui/source/default_element_factory.cpp b/libs/ui/source/default_element_factory.cpp index 438b9001..dd153a77 100644 --- a/libs/ui/source/default_element_factory.cpp +++ b/libs/ui/source/default_element_factory.cpp @@ -135,15 +135,15 @@ namespace psemek::ui if (min_size()) { auto s = *min_size(); - r[0].min = s[0]; - r[1].min = s[1]; + r[0].min = std::max(r[0].min, s[0]); + r[1].min = std::max(r[1].min, s[1]); } if (max_size()) { auto s = *max_size(); - r[0].max = s[0]; - r[1].max = s[1]; + r[0].max = std::min(r[0].max, s[0]); + r[1].max = std::min(r[1].max, s[1]); } return r;