Compare commits
2 Commits
v3.0.0
...
woehrl01/f
Author | SHA1 | Date | |
---|---|---|---|
|
cb5c77224e | ||
|
1e1e5cb477 |
@@ -88,3 +88,7 @@
|
|||||||
<div style="width:20px; height:20px; position: absolute; align-self: flex-end;"></div>
|
<div style="width:20px; height:20px; position: absolute; align-self: flex-end;"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="absolute_layout_percentage_from_padded_parent" style="flex-direction:column; width:750px; height:1000px; padding-top: 100px; border-top: 100px;">
|
||||||
|
<div style="width:750px; height:50%; position: absolute;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@@ -184,9 +184,7 @@ TEST(YogaTest, absolute_layout_width_height_start_top_end_bottom) {
|
|||||||
YGConfigFree(config);
|
YGConfigFree(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(
|
TEST(YogaTest, do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent) {
|
||||||
YogaTest,
|
|
||||||
do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent) {
|
|
||||||
const YGConfigRef config = YGConfigNew();
|
const YGConfigRef config = YGConfigNew();
|
||||||
|
|
||||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||||
@@ -578,9 +576,7 @@ TEST(YogaTest, absolute_layout_align_items_center_on_child_only) {
|
|||||||
YGConfigFree(config);
|
YGConfigFree(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(
|
TEST(YogaTest, absolute_layout_align_items_and_justify_content_center_and_top_position) {
|
||||||
YogaTest,
|
|
||||||
absolute_layout_align_items_and_justify_content_center_and_top_position) {
|
|
||||||
const YGConfigRef config = YGConfigNew();
|
const YGConfigRef config = YGConfigNew();
|
||||||
|
|
||||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||||
@@ -625,9 +621,7 @@ TEST(
|
|||||||
YGConfigFree(config);
|
YGConfigFree(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(
|
TEST(YogaTest, absolute_layout_align_items_and_justify_content_center_and_bottom_position) {
|
||||||
YogaTest,
|
|
||||||
absolute_layout_align_items_and_justify_content_center_and_bottom_position) {
|
|
||||||
const YGConfigRef config = YGConfigNew();
|
const YGConfigRef config = YGConfigNew();
|
||||||
|
|
||||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||||
@@ -672,9 +666,7 @@ TEST(
|
|||||||
YGConfigFree(config);
|
YGConfigFree(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(
|
TEST(YogaTest, absolute_layout_align_items_and_justify_content_center_and_left_position) {
|
||||||
YogaTest,
|
|
||||||
absolute_layout_align_items_and_justify_content_center_and_left_position) {
|
|
||||||
const YGConfigRef config = YGConfigNew();
|
const YGConfigRef config = YGConfigNew();
|
||||||
|
|
||||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||||
@@ -719,9 +711,7 @@ TEST(
|
|||||||
YGConfigFree(config);
|
YGConfigFree(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(
|
TEST(YogaTest, absolute_layout_align_items_and_justify_content_center_and_right_position) {
|
||||||
YogaTest,
|
|
||||||
absolute_layout_align_items_and_justify_content_center_and_right_position) {
|
|
||||||
const YGConfigRef config = YGConfigNew();
|
const YGConfigRef config = YGConfigNew();
|
||||||
|
|
||||||
const YGNodeRef root = YGNodeNewWithConfig(config);
|
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||||
@@ -1039,3 +1029,46 @@ TEST(YogaTest, absolute_layout_in_wrap_reverse_row_container_flex_end) {
|
|||||||
|
|
||||||
YGConfigFree(config);
|
YGConfigFree(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(YogaTest, absolute_layout_percentage_from_padded_parent) {
|
||||||
|
const YGConfigRef config = YGConfigNew();
|
||||||
|
|
||||||
|
const YGNodeRef root = YGNodeNewWithConfig(config);
|
||||||
|
YGNodeStyleSetPadding(root, YGEdgeTop, 100);
|
||||||
|
YGNodeStyleSetBorder(root, YGEdgeTop, 100);
|
||||||
|
YGNodeStyleSetWidth(root, 750);
|
||||||
|
YGNodeStyleSetHeight(root, 1000);
|
||||||
|
|
||||||
|
const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
|
||||||
|
YGNodeStyleSetPositionType(root_child0, YGPositionTypeAbsolute);
|
||||||
|
YGNodeStyleSetWidth(root_child0, 750);
|
||||||
|
YGNodeStyleSetHeightPercent(root_child0, 50);
|
||||||
|
YGNodeInsertChild(root, root_child0, 0);
|
||||||
|
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
|
||||||
|
|
||||||
|
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root));
|
||||||
|
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root));
|
||||||
|
ASSERT_FLOAT_EQ(750, YGNodeLayoutGetWidth(root));
|
||||||
|
ASSERT_FLOAT_EQ(1000, YGNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
|
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0));
|
||||||
|
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetTop(root_child0));
|
||||||
|
ASSERT_FLOAT_EQ(750, YGNodeLayoutGetWidth(root_child0));
|
||||||
|
ASSERT_FLOAT_EQ(500, YGNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
|
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionRTL);
|
||||||
|
|
||||||
|
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root));
|
||||||
|
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root));
|
||||||
|
ASSERT_FLOAT_EQ(750, YGNodeLayoutGetWidth(root));
|
||||||
|
ASSERT_FLOAT_EQ(1000, YGNodeLayoutGetHeight(root));
|
||||||
|
|
||||||
|
ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0));
|
||||||
|
ASSERT_FLOAT_EQ(100, YGNodeLayoutGetTop(root_child0));
|
||||||
|
ASSERT_FLOAT_EQ(750, YGNodeLayoutGetWidth(root_child0));
|
||||||
|
ASSERT_FLOAT_EQ(500, YGNodeLayoutGetHeight(root_child0));
|
||||||
|
|
||||||
|
YGNodeFreeRecursive(root);
|
||||||
|
|
||||||
|
YGConfigFree(config);
|
||||||
|
}
|
||||||
|
@@ -2599,7 +2599,7 @@ static void YGJustifyMainAxis(
|
|||||||
} else if (performLayout) {
|
} else if (performLayout) {
|
||||||
child->setLayoutPosition(
|
child->setLayoutPosition(
|
||||||
childLayout.position[pos[mainAxis]] +
|
childLayout.position[pos[mainAxis]] +
|
||||||
node->getLeadingBorder(mainAxis) + leadingMainDim,
|
node->getLeadingPadding(mainAxis, ownerWidth).unwrap() + leadingMainDim,
|
||||||
pos[mainAxis]);
|
pos[mainAxis]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3522,9 +3522,9 @@ static void YGNodelayoutImpl(
|
|||||||
YGNodeAbsoluteLayoutChild(
|
YGNodeAbsoluteLayoutChild(
|
||||||
node,
|
node,
|
||||||
child,
|
child,
|
||||||
availableInnerWidth,
|
availableWidth,
|
||||||
isMainAxisRow ? measureModeMainDim : measureModeCrossDim,
|
isMainAxisRow ? measureModeMainDim : measureModeCrossDim,
|
||||||
availableInnerHeight,
|
availableHeight,
|
||||||
direction,
|
direction,
|
||||||
config,
|
config,
|
||||||
layoutMarkerData,
|
layoutMarkerData,
|
||||||
|
Reference in New Issue
Block a user