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
This commit is contained in:
David Aurelio
2018-08-17 03:56:35 -07:00
committed by Facebook Github Bot
parent 8309cfc976
commit 6132a59772

View File

@@ -11,6 +11,8 @@
#include "Yoga.h" #include "Yoga.h"
struct YGStyle { struct YGStyle {
using Dimensions = std::array<YGValue, 2>;
YGDirection direction; YGDirection direction;
YGFlexDirection flexDirection; YGFlexDirection flexDirection;
YGJustify justifyContent; YGJustify justifyContent;
@@ -29,9 +31,9 @@ struct YGStyle {
std::array<YGValue, YGEdgeCount> position; std::array<YGValue, YGEdgeCount> position;
std::array<YGValue, YGEdgeCount> padding; std::array<YGValue, YGEdgeCount> padding;
std::array<YGValue, YGEdgeCount> border; std::array<YGValue, YGEdgeCount> border;
std::array<YGValue, 2> dimensions; Dimensions dimensions;
std::array<YGValue, 2> minDimensions; Dimensions minDimensions;
std::array<YGValue, 2> maxDimensions; Dimensions maxDimensions;
// Yoga specific properties, not compatible with flexbox specification // Yoga specific properties, not compatible with flexbox specification
YGFloatOptional aspectRatio; YGFloatOptional aspectRatio;