aboutsummaryrefslogtreecommitdiff
path: root/CruUI/ui/controls/linear_layout.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-09-15 23:28:06 +0800
committercrupest <crupest@outlook.com>2018-09-15 23:28:06 +0800
commit683419f2856d348436ca64cfd4b3abbfc73cda89 (patch)
treeeed6f7b324ca2a4a6b7cdf7879233eb2eacedf2c /CruUI/ui/controls/linear_layout.cpp
parent8248001b2506a866b6be0e22af36f8399a595da2 (diff)
downloadcru-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.cpp6
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
{