Skip to content

Commit

Permalink
call margin method on child instead of node
Browse files Browse the repository at this point in the history
Reviewed By: emilsjolander

Differential Revision: D6918367

fbshipit-source-id: cee90e015f9e45a717a7307f59fd3b9ef6f399b6
  • Loading branch information
priteshrnandgaonkar authored and facebook-github-bot committed Feb 8, 2018
1 parent 09b43e4 commit f75e21f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ReactCommon/yoga/yoga/Yoga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1037,9 +1037,9 @@ static void YGNodeComputeFlexBasisForChild(const YGNodeRef node,
childHeightMeasureMode = YGMeasureModeUndefined;

const float marginRow =
node->getMarginForAxis(YGFlexDirectionRow, parentWidth);
child->getMarginForAxis(YGFlexDirectionRow, parentWidth);
const float marginColumn =
node->getMarginForAxis(YGFlexDirectionColumn, parentWidth);
child->getMarginForAxis(YGFlexDirectionColumn, parentWidth);

if (isRowStyleDimDefined) {
childWidth =
Expand Down Expand Up @@ -2624,9 +2624,8 @@ static void YGNodelayoutImpl(const YGNodeRef node,
}
if (child->getStyle().positionType == YGPositionTypeAbsolute) {
// If the child is absolutely positioned and has a
// top/left/bottom/right
// set, override all the previously computed positions to set it
// correctly.
// top/left/bottom/right set, override
// all the previously computed positions to set it correctly.
const bool isChildLeadingPosDefined =
child->isLeadingPositionDefined(crossAxis);
if (isChildLeadingPosDefined) {
Expand Down

0 comments on commit f75e21f

Please sign in to comment.