2019-06-06 19:36:56 -07:00
|
|
|
/*
|
2022-10-04 13:59:32 -07:00
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
2018-10-24 03:09:58 -07:00
|
|
|
*
|
2019-10-15 10:30:08 -07:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2018-10-24 03:09:58 -07:00
|
|
|
*/
|
2019-10-15 10:30:08 -07:00
|
|
|
|
2017-01-04 04:33:39 -08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <yoga/Yoga.h>
|
|
|
|
|
2019-03-25 05:37:36 -07:00
|
|
|
struct Value {
|
|
|
|
static Value fromYGValue(YGValue const& ygValue) {
|
|
|
|
return Value(static_cast<int>(ygValue.unit), ygValue.value);
|
|
|
|
}
|
2017-01-04 04:33:39 -08:00
|
|
|
|
2019-03-25 05:37:36 -07:00
|
|
|
int unit;
|
|
|
|
double value;
|
2017-01-04 04:33:39 -08:00
|
|
|
|
2019-03-25 05:37:36 -07:00
|
|
|
Value(void) : unit(YGUnitUndefined), value(0.0) {}
|
2017-01-04 04:33:39 -08:00
|
|
|
|
2019-03-25 05:37:36 -07:00
|
|
|
Value(int unit, double value) : unit(unit), value(value) {}
|
2017-01-04 04:33:39 -08:00
|
|
|
};
|