Files
react-native/ReactCommon/flexlayout/flexlayout/FlexLine.h
T
J.T. Yim 4eec47344e Add flexlayout dirSync to react-native-github
Summary:
Changelog:
[Internal] Include FlexLayout C++ source to ReactCommons

Reviewed By: d16r, NickGerleman

Differential Revision: D38716145

fbshipit-source-id: 0ca2ab040e72168f2f1b479609b6cda2787eba66
2022-08-17 09:55:15 -07:00

48 lines
1.1 KiB
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 <cstdint>
#include <vector>
#include "FlexItem.h"
namespace facebook {
namespace flexlayout {
namespace algo {
struct FlexLine {
std::vector<FlexItem> flexItems;
float crossDim = 0.0f;
float mainDim = 0.0f;
float maxBaseline = 0.0f;
/**
Resolves flexible lengths on the main axis according to
https://www.w3.org/TR/css-flexbox-1/#resolve-flexible-lengths .
Preconditions:
- All items have defined flex base size (i.e. \c
FlexItem::computedFlexBasis), see
https://www.w3.org/TR/css-flexbox-1/#flex-base-size
Postconditions:
- All items have defined used main sizes (i.e. \c FlexItem::targetMainSize)
\returns the amount of free space available for justification
*/
auto resolveFlexibleLengths(
FlexDirection mainAxis,
Float availableInnerMainDim,
Float availableInnerWidth,
bool sizeBasedOnContent) -> Float;
};
} // namespace algo
} // namespace flexlayout
} // namespace facebook