diff options
author | crupest <crupest@outlook.com> | 2018-09-15 23:28:06 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2018-09-15 23:28:06 +0800 |
commit | 683419f2856d348436ca64cfd4b3abbfc73cda89 (patch) | |
tree | eed6f7b324ca2a4a6b7cdf7879233eb2eacedf2c /CruUI/ui/controls/linear_layout.cpp | |
parent | 8248001b2506a866b6be0e22af36f8399a595da2 (diff) | |
download | cru-683419f2856d348436ca64cfd4b3abbfc73cda89.tar.gz cru-683419f2856d348436ca64cfd4b3abbfc73cda89.tar.bz2 cru-683419f2856d348436ca64cfd4b3abbfc73cda89.zip |
...
Diffstat (limited to 'CruUI/ui/controls/linear_layout.cpp')
-rw-r--r-- | CruUI/ui/controls/linear_layout.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/CruUI/ui/controls/linear_layout.cpp b/CruUI/ui/controls/linear_layout.cpp index 1d88a4e1..33a7855f 100644 --- a/CruUI/ui/controls/linear_layout.cpp +++ b/CruUI/ui/controls/linear_layout.cpp @@ -57,7 +57,11 @@ namespace cru::ui::controls } }); - auto actual_size_for_children = total_available_size_for_children - rest_available_size_for_children; + auto actual_size_for_children = total_available_size_for_children; + if (orientation_ == Orientation::Horizontal) + actual_size_for_children.width -= rest_available_size_for_children.width; + else + actual_size_for_children.height -= rest_available_size_for_children.height; auto&& calculate_final_length = [](const MeasureLength& layout_length, const float length_for_children, const float max_child_length) -> float { |