aboutsummaryrefslogtreecommitdiff
path: root/src/ui/render/FlexLayoutRenderObject.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-10-18 21:28:35 +0800
committercrupest <crupest@outlook.com>2020-10-18 21:28:35 +0800
commitc072432e68d7a3d7659add0994b2f8caf387ddf2 (patch)
tree6031f93ee2997485d13669a55c080a2a624bd3da /src/ui/render/FlexLayoutRenderObject.cpp
parent5729a5aa1b443e3e25f3e14dee29636d3b31a6f8 (diff)
downloadcru-c072432e68d7a3d7659add0994b2f8caf387ddf2.tar.gz
cru-c072432e68d7a3d7659add0994b2f8caf387ddf2.tar.bz2
cru-c072432e68d7a3d7659add0994b2f8caf387ddf2.zip
...
Diffstat (limited to 'src/ui/render/FlexLayoutRenderObject.cpp')
-rw-r--r--src/ui/render/FlexLayoutRenderObject.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/ui/render/FlexLayoutRenderObject.cpp b/src/ui/render/FlexLayoutRenderObject.cpp
index 1c39cc8f..36a2dcea 100644
--- a/src/ui/render/FlexLayoutRenderObject.cpp
+++ b/src/ui/render/FlexLayoutRenderObject.cpp
@@ -391,10 +391,11 @@ void FlexLayoutRenderObject::OnLayoutContent(const Rect& content_rect) {
const auto cross_align =
GetChildLayoutDataList()[i].cross_alignment.value_or(
GetItemCrossAlign());
- child->Layout(
- Point{content_rect.top + current_main_offset,
- CalculateAnchorByAlignment(cross_align, content_rect.left,
- content_rect.width, size.width)});
+ child->Layout(Point{
+ CalculateAnchorByAlignment(cross_align, content_rect.left,
+ content_rect.width, size.width),
+ content_rect.top + current_main_offset,
+ });
current_main_offset += size.height;
}
} else {
@@ -406,9 +407,9 @@ void FlexLayoutRenderObject::OnLayoutContent(const Rect& content_rect) {
GetChildLayoutDataList()[i].cross_alignment.value_or(
GetItemCrossAlign());
child->Layout(
- Point{content_rect.GetBottom() - current_main_offset,
- CalculateAnchorByAlignment(cross_align, content_rect.left,
- content_rect.width, size.width)});
+ Point{CalculateAnchorByAlignment(cross_align, content_rect.left,
+ content_rect.width, size.width),
+ content_rect.GetBottom() - current_main_offset});
current_main_offset += size.height;
}
}