Fix issue where borderStart and borderEnd were swapped with row reverse (#1425)
Summary: X-link: https://github.com/facebook/react-native/pull/41022 Pull Request resolved: https://github.com/facebook/yoga/pull/1425 Just like D50140503 where marginStart and marginEnd were not working with row reverse, borderStart and borderEnd are not working either with row reverse either. The solution is similar - we were checking the flex item layout starting/ending edges and not the general layout starting/ending edges. This change makes it so that we look at the proper edge according to what direction is set. One caveat is that in the case of border (and also padding) there is a callsite that actually wants to get the flex item layout's leading/trailing border and not the one dictated by direction. So, I made a new function to accommodate this and just swapped that callsite out. Reviewed By: NickGerleman Differential Revision: D50348085 fbshipit-source-id: eca2702c1753dbebb503034e2f0732684ad6c56e
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e17005960f
commit
b52d6ce7f2
@@ -208,12 +208,32 @@ class YG_EXPORT Node : public ::YGNode {
|
||||
FlexDirection axis,
|
||||
Direction direction,
|
||||
float widthSize) const;
|
||||
float getFlexStartBorder(FlexDirection flexDirection) const;
|
||||
float getFlexEndBorder(FlexDirection flexDirection) const;
|
||||
float getFlexStartBorder(FlexDirection flexDirection, Direction direction)
|
||||
const;
|
||||
float getInlineStartBorder(FlexDirection flexDirection, Direction direction)
|
||||
const;
|
||||
float getFlexEndBorder(FlexDirection flexDirection, Direction direction)
|
||||
const;
|
||||
float getInlineEndBorder(FlexDirection flexDirection, Direction direction)
|
||||
const;
|
||||
float getFlexStartPadding(FlexDirection axis, float widthSize) const;
|
||||
float getFlexEndPadding(FlexDirection axis, float widthSize) const;
|
||||
float getFlexStartPaddingAndBorder(FlexDirection axis, float widthSize) const;
|
||||
float getFlexEndPaddingAndBorder(FlexDirection axis, float widthSize) const;
|
||||
float getFlexStartPaddingAndBorder(
|
||||
FlexDirection axis,
|
||||
Direction direction,
|
||||
float widthSize) const;
|
||||
float getInlineStartPaddingAndBorder(
|
||||
FlexDirection axis,
|
||||
Direction direction,
|
||||
float widthSize) const;
|
||||
float getFlexEndPaddingAndBorder(
|
||||
FlexDirection axis,
|
||||
Direction direction,
|
||||
float widthSize) const;
|
||||
float getInlineEndPaddingAndBorder(
|
||||
FlexDirection axis,
|
||||
Direction direction,
|
||||
float widthSize) const;
|
||||
float getMarginForAxis(FlexDirection axis, float widthSize) const;
|
||||
float getGapForAxis(FlexDirection axis) const;
|
||||
// Setters
|
||||
|
Reference in New Issue
Block a user