call margin method on child instead of node

Summary: While moving a function as a method in YGNode, there was an error in which I mistakenly called a method on node, whereas I had to call it on child.

Reviewed By: emilsjolander

Differential Revision: D6918367

fbshipit-source-id: cee90e015f9e45a717a7307f59fd3b9ef6f399b6
This commit is contained in:
Pritesh Nandgaonkar
2018-02-07 17:19:53 -08:00
committed by Facebook Github Bot
parent 7eb8df2777
commit d66239bea8

View File

@@ -1037,9 +1037,9 @@ static void YGNodeComputeFlexBasisForChild(const YGNodeRef node,
childHeightMeasureMode = YGMeasureModeUndefined; childHeightMeasureMode = YGMeasureModeUndefined;
const float marginRow = const float marginRow =
node->getMarginForAxis(YGFlexDirectionRow, parentWidth); child->getMarginForAxis(YGFlexDirectionRow, parentWidth);
const float marginColumn = const float marginColumn =
node->getMarginForAxis(YGFlexDirectionColumn, parentWidth); child->getMarginForAxis(YGFlexDirectionColumn, parentWidth);
if (isRowStyleDimDefined) { if (isRowStyleDimDefined) {
childWidth = childWidth =
@@ -2624,9 +2624,8 @@ static void YGNodelayoutImpl(const YGNodeRef node,
} }
if (child->getStyle().positionType == YGPositionTypeAbsolute) { if (child->getStyle().positionType == YGPositionTypeAbsolute) {
// If the child is absolutely positioned and has a // If the child is absolutely positioned and has a
// top/left/bottom/right // top/left/bottom/right set, override
// set, override all the previously computed positions to set it // all the previously computed positions to set it correctly.
// correctly.
const bool isChildLeadingPosDefined = const bool isChildLeadingPosDefined =
child->isLeadingPositionDefined(crossAxis); child->isLeadingPositionDefined(crossAxis);
if (isChildLeadingPosDefined) { if (isChildLeadingPosDefined) {