David Aurelio b7c079f96f Type alias for dimensions
Summary:
Aliases `std::array<YGValue, 2>` as `YGStyle::Dimensions` for increased readability.

This prepares a follow up, where the alias is used in `Yoga.cpp`.

Reviewed By: astreet

Differential Revision: D8874566

fbshipit-source-id: a7a7a1b02bff547d7d6b800c522c4785a62ad611
2018-08-17 04:02:30 -07:00

48 lines
1.2 KiB
C++

/*
* Copyright (c) 2014-present, Facebook, Inc.
*
* 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 "YGFloatOptional.h"
#include "Yoga-internal.h"
#include "Yoga.h"
struct YGStyle {
using Dimensions = std::array<YGValue, 2>;
YGDirection direction;
YGFlexDirection flexDirection;
YGJustify justifyContent;
YGAlign alignContent;
YGAlign alignItems;
YGAlign alignSelf;
YGPositionType positionType;
YGWrap flexWrap;
YGOverflow overflow;
YGDisplay display;
YGFloatOptional flex;
YGFloatOptional flexGrow;
YGFloatOptional flexShrink;
YGValue flexBasis;
std::array<YGValue, YGEdgeCount> margin;
std::array<YGValue, YGEdgeCount> position;
std::array<YGValue, YGEdgeCount> padding;
std::array<YGValue, YGEdgeCount> border;
Dimensions dimensions;
Dimensions minDimensions;
Dimensions maxDimensions;
// Yoga specific properties, not compatible with flexbox specification
YGFloatOptional aspectRatio;
YGStyle();
bool operator==(const YGStyle& style);
bool operator!=(YGStyle style) {
return !(*this == style);
}
~YGStyle() = default;
};