Summary: Moved YGNodeLeading position as a method on YGNode Reviewed By: emilsjolander Differential Revision: D6682929 fbshipit-source-id: 3607aab1544b62b1126c5d75b2f6fb8f5ca2d45f
32 lines
848 B
C++
32 lines
848 B
C++
/**
|
|
* Copyright (c) 2014-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
|
|
#include "Utils.h"
|
|
|
|
YGFlexDirection YGFlexDirectionCross(
|
|
const YGFlexDirection flexDirection,
|
|
const YGDirection direction) {
|
|
return YGFlexDirectionIsColumn(flexDirection)
|
|
? YGResolveFlexDirection(YGFlexDirectionRow, direction)
|
|
: YGFlexDirectionColumn;
|
|
}
|
|
|
|
bool YGValueEqual(const YGValue a, const YGValue b) {
|
|
if (a.unit != b.unit) {
|
|
return false;
|
|
}
|
|
|
|
if (a.unit == YGUnitUndefined ||
|
|
(std::isnan(a.value) && std::isnan(b.value))) {
|
|
return true;
|
|
}
|
|
|
|
return fabs(a.value - b.value) < 0.0001f;
|
|
}
|