Summary: X-link: https://github.com/facebook/react-native/pull/39497 Pull Request resolved: https://github.com/facebook/yoga/pull/1395 Moves internal usages of YGAlign to Align bypass-github-export-checks Changelog: [Internal] Reviewed By: rshest Differential Revision: D49337511 fbshipit-source-id: bb9906fcd22780d2cfd8d1360ef69f66b9701bb6
30 lines
729 B
C++
30 lines
729 B
C++
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <yoga/Yoga.h>
|
|
|
|
#include <yoga/algorithm/FlexDirection.h>
|
|
#include <yoga/node/Node.h>
|
|
|
|
namespace facebook::yoga {
|
|
|
|
inline Align resolveChildAlignment(
|
|
const yoga::Node* node,
|
|
const yoga::Node* child) {
|
|
const Align align = child->getStyle().alignSelf() == Align::Auto
|
|
? node->getStyle().alignItems()
|
|
: child->getStyle().alignSelf();
|
|
if (align == Align::Baseline && isColumn(node->getStyle().flexDirection())) {
|
|
return Align::FlexStart;
|
|
}
|
|
return align;
|
|
}
|
|
|
|
} // namespace facebook::yoga
|