From 5d91d1e5594e37ca5c282e602407eaeb34c6d986 Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 22 Sep 2018 22:57:44 +0800 Subject: Done 3 things: 1. Add some helper functions for create controls with layout params. 2. Fix a bug in measure of linear layout. 3. Fix a bug in exception. --- CruUI/ui/controls/linear_layout.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'CruUI/ui/controls/linear_layout.cpp') diff --git a/CruUI/ui/controls/linear_layout.cpp b/CruUI/ui/controls/linear_layout.cpp index 116802ba..22bf26e9 100644 --- a/CruUI/ui/controls/linear_layout.cpp +++ b/CruUI/ui/controls/linear_layout.cpp @@ -89,7 +89,7 @@ namespace cru::ui::controls const auto available_width = rest_available_size_for_children.width / stretch_control_list.size(); for (const auto control : stretch_control_list) { - control->Measure(Size(available_width, AtLeast0(rest_available_size_for_children.height))); + control->Measure(Size(AtLeast0(available_width), rest_available_size_for_children.height)); const auto size = control->GetDesiredSize(); rest_available_size_for_children.width -= size.width; secondary_side_child_max_length = std::max(size.height, secondary_side_child_max_length); @@ -100,7 +100,7 @@ namespace cru::ui::controls const auto available_height = rest_available_size_for_children.height / stretch_control_list.size(); for (const auto control : stretch_control_list) { - control->Measure(Size(AtLeast0(rest_available_size_for_children.width), available_height)); + control->Measure(Size(rest_available_size_for_children.width, AtLeast0(available_height))); const auto size = control->GetDesiredSize(); rest_available_size_for_children.height -= size.height; secondary_side_child_max_length = std::max(size.width, secondary_side_child_max_length); -- cgit v1.2.3