Fix issue where percentages were off of the border box, not padding box (#1485)
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1485 X-link: https://github.com/facebook/react-native/pull/41686 The size of the containing block is the size of the padding box of the containing node for absolute nodes. We were looking at `containingNode->getLayout().measuredDimension(Dimension::Width)` which is the border box. So we need to subtract the border from this. Added a test that was failing before this change as well Reviewed By: NickGerleman Differential Revision: D51330526 fbshipit-source-id: adc448dfb71b54f1bbed0d9d61c5553bda4b106c
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f6c4a8e8e4
commit
9b87d8b3f3
@@ -377,6 +377,11 @@ float Node::getFlexEndPaddingAndBorder(
|
||||
getFlexEndBorder(axis, direction);
|
||||
}
|
||||
|
||||
float Node::getBorderForAxis(FlexDirection axis) const {
|
||||
return getInlineStartBorder(axis, Direction::LTR) +
|
||||
getInlineEndBorder(axis, Direction::LTR);
|
||||
}
|
||||
|
||||
float Node::getMarginForAxis(FlexDirection axis, float widthSize) const {
|
||||
// The total margin for a given axis does not depend on the direction
|
||||
// so hardcoding LTR here to avoid piping direction to this function
|
||||
|
Reference in New Issue
Block a user