Remove style property bitmask
Summary: @public Removes the style properties bitmask. We have used this for experimentation, and it's no longer necessary. This simplifyies the code, and allows us to cut over to `Bitfield.h` more easily. Reviewed By: astreet Differential Revision: D16648862 fbshipit-source-id: 17c0899807af976f4ba34db54f8f0f6a3cd92519
This commit is contained in:
committed by
Facebook Github Bot
parent
dadf0473b7
commit
3ed9bec05c
@@ -11,22 +11,9 @@
|
|||||||
#include <yoga/YGStyle.h>
|
#include <yoga/YGStyle.h>
|
||||||
#include <yoga/YGValue.h>
|
#include <yoga/YGValue.h>
|
||||||
|
|
||||||
#include <utility>
|
|
||||||
|
|
||||||
using AssignedProps =
|
|
||||||
std::remove_reference<decltype(YGStyle{}.assignedProps())>::type;
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
constexpr AssignedProps setBits(int from, int n) {
|
|
||||||
return n > 0 ? (setBits(from, n - 1) | AssignedProps{1ull << (from + n - 1)})
|
|
||||||
: 0;
|
|
||||||
}
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#define ACCESSOR_TESTS_1(NAME, X) \
|
#define ACCESSOR_TESTS_1(NAME, X) \
|
||||||
style.NAME() = X; \
|
style.NAME() = X; \
|
||||||
ASSERT_EQ(style.NAME(), X); \
|
ASSERT_EQ(style.NAME(), X);
|
||||||
ASSERT_EQ(style.assignedProps(), AssignedProps{1ull << YGStyle::NAME##Bit});
|
|
||||||
#define ACCESSOR_TESTS_2(NAME, X, ...) \
|
#define ACCESSOR_TESTS_2(NAME, X, ...) \
|
||||||
ACCESSOR_TESTS_1(NAME, X); \
|
ACCESSOR_TESTS_1(NAME, X); \
|
||||||
ACCESSOR_TESTS_1(NAME, __VA_ARGS__);
|
ACCESSOR_TESTS_1(NAME, __VA_ARGS__);
|
||||||
@@ -48,17 +35,9 @@ constexpr AssignedProps setBits(int from, int n) {
|
|||||||
auto style = YGStyle{}; \
|
auto style = YGStyle{}; \
|
||||||
style.NAME()[IDX] = X; \
|
style.NAME()[IDX] = X; \
|
||||||
ASSERT_EQ(style.NAME()[IDX], X); \
|
ASSERT_EQ(style.NAME()[IDX], X); \
|
||||||
ASSERT_EQ( \
|
|
||||||
style.assignedProps(), \
|
|
||||||
AssignedProps{1ull << (YGStyle::NAME##Bit + IDX)}); \
|
|
||||||
auto asArray = decltype(std::declval<const YGStyle&>().NAME()){X}; \
|
auto asArray = decltype(std::declval<const YGStyle&>().NAME()){X}; \
|
||||||
style.NAME() = asArray; \
|
style.NAME() = asArray; \
|
||||||
ASSERT_EQ(static_cast<decltype(asArray)>(style.NAME()), asArray); \
|
ASSERT_EQ(static_cast<decltype(asArray)>(style.NAME()), asArray); \
|
||||||
ASSERT_EQ( \
|
|
||||||
style.assignedProps(), \
|
|
||||||
AssignedProps{setBits( \
|
|
||||||
YGStyle::NAME##Bit, \
|
|
||||||
facebook::yoga::enums::count<decltype(IDX)>())}); \
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define INDEX_ACCESSOR_TESTS_2(NAME, IDX, X, Y) \
|
#define INDEX_ACCESSOR_TESTS_2(NAME, IDX, X, Y) \
|
||||||
@@ -93,7 +72,6 @@ constexpr AssignedProps setBits(int from, int n) {
|
|||||||
#define INDEX_ACCESSOR_TEST(NAME, DEFAULT_VAL, IDX, ...) \
|
#define INDEX_ACCESSOR_TEST(NAME, DEFAULT_VAL, IDX, ...) \
|
||||||
TEST(YGStyle, style_##NAME##_access) { \
|
TEST(YGStyle, style_##NAME##_access) { \
|
||||||
ASSERT_EQ(YGStyle{}.NAME()[IDX], DEFAULT_VAL); \
|
ASSERT_EQ(YGStyle{}.NAME()[IDX], DEFAULT_VAL); \
|
||||||
ASSERT_EQ(YGStyle{}.assignedProps(), 0); \
|
|
||||||
INDEX_ACCESSOR_TESTS(__VA_ARGS__)(NAME, IDX, __VA_ARGS__) \
|
INDEX_ACCESSOR_TESTS(__VA_ARGS__)(NAME, IDX, __VA_ARGS__) \
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,122 +248,5 @@ ACCESSOR_TEST(
|
|||||||
YGFloatOptional{0.0f},
|
YGFloatOptional{0.0f},
|
||||||
YGFloatOptional{});
|
YGFloatOptional{});
|
||||||
|
|
||||||
TEST(YGStyle, set_properties_default_to_0) {
|
|
||||||
ASSERT_EQ(YGStyle{}.assignedProps(), AssignedProps{0});
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(YGStyle, set_properties_reflects_all_set_properties) {
|
|
||||||
auto style = YGStyle{};
|
|
||||||
|
|
||||||
style.direction() = YGDirectionRTL;
|
|
||||||
style.justifyContent() = YGJustifySpaceAround;
|
|
||||||
style.flexWrap() = YGWrapWrap;
|
|
||||||
style.padding()[YGEdgeVertical] = YGValue{1, YGUnitPoint};
|
|
||||||
style.minDimensions()[YGDimensionHeight] = YGValue{1, YGUnitPercent};
|
|
||||||
style.aspectRatio() = YGFloatOptional{1.23};
|
|
||||||
|
|
||||||
ASSERT_EQ(
|
|
||||||
style.assignedProps(),
|
|
||||||
AssignedProps{1ull << YGStyle::directionBit |
|
|
||||||
1ull << YGStyle::justifyContentBit |
|
|
||||||
1ull << YGStyle::flexWrapBit |
|
|
||||||
1ull << (YGStyle::paddingBit + YGEdgeVertical) |
|
|
||||||
1ull << (YGStyle::minDimensionsBit + YGDimensionHeight) |
|
|
||||||
1ull << YGStyle::aspectRatioBit});
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(YGStyle, directionBit) {
|
|
||||||
constexpr auto directionBit = YGStyle::directionBit;
|
|
||||||
ASSERT_EQ(directionBit, 0);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, flexDirectionBit) {
|
|
||||||
constexpr auto flexDirectionBit = YGStyle::flexDirectionBit;
|
|
||||||
ASSERT_EQ(flexDirectionBit, 1);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, justifyContentBit) {
|
|
||||||
constexpr auto justifyContentBit = YGStyle::justifyContentBit;
|
|
||||||
ASSERT_EQ(justifyContentBit, 2);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, alignContentBit) {
|
|
||||||
constexpr auto alignContentBit = YGStyle::alignContentBit;
|
|
||||||
ASSERT_EQ(alignContentBit, 3);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, alignItemsBit) {
|
|
||||||
constexpr auto alignItemsBit = YGStyle::alignItemsBit;
|
|
||||||
ASSERT_EQ(alignItemsBit, 4);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, alignSelfBit) {
|
|
||||||
constexpr auto alignSelfBit = YGStyle::alignSelfBit;
|
|
||||||
ASSERT_EQ(alignSelfBit, 5);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, positionTypeBit) {
|
|
||||||
constexpr auto positionTypeBit = YGStyle::positionTypeBit;
|
|
||||||
ASSERT_EQ(positionTypeBit, 6);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, flexWrapBit) {
|
|
||||||
constexpr auto flexWrapBit = YGStyle::flexWrapBit;
|
|
||||||
ASSERT_EQ(flexWrapBit, 7);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, overflowBit) {
|
|
||||||
constexpr auto overflowBit = YGStyle::overflowBit;
|
|
||||||
ASSERT_EQ(overflowBit, 8);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, displayBit) {
|
|
||||||
constexpr auto displayBit = YGStyle::displayBit;
|
|
||||||
ASSERT_EQ(displayBit, 9);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, flexBit) {
|
|
||||||
constexpr auto flexBit = YGStyle::flexBit;
|
|
||||||
ASSERT_EQ(flexBit, 10);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, flexGrowBit) {
|
|
||||||
constexpr auto flexGrowBit = YGStyle::flexGrowBit;
|
|
||||||
ASSERT_EQ(flexGrowBit, 11);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, flexShrinkBit) {
|
|
||||||
constexpr auto flexShrinkBit = YGStyle::flexShrinkBit;
|
|
||||||
ASSERT_EQ(flexShrinkBit, 12);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, flexBasisBit) {
|
|
||||||
constexpr auto flexBasisBit = YGStyle::flexBasisBit;
|
|
||||||
ASSERT_EQ(flexBasisBit, 13);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, marginBit) {
|
|
||||||
constexpr auto marginBit = YGStyle::marginBit;
|
|
||||||
ASSERT_EQ(marginBit, 14);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, positionBit) {
|
|
||||||
constexpr auto positionBit = YGStyle::positionBit;
|
|
||||||
ASSERT_EQ(positionBit, 23);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, paddingBit) {
|
|
||||||
constexpr auto paddingBit = YGStyle::paddingBit;
|
|
||||||
ASSERT_EQ(paddingBit, 32);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, borderBit) {
|
|
||||||
constexpr auto borderBit = YGStyle::borderBit;
|
|
||||||
ASSERT_EQ(borderBit, 41);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, dimensionsBit) {
|
|
||||||
constexpr auto dimensionsBit = YGStyle::dimensionsBit;
|
|
||||||
ASSERT_EQ(dimensionsBit, 50);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, maxDimensionsBit) {
|
|
||||||
constexpr auto maxDimensionsBit = YGStyle::maxDimensionsBit;
|
|
||||||
ASSERT_EQ(maxDimensionsBit, 52);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, minDimensionsBit) {
|
|
||||||
constexpr auto minDimensionsBit = YGStyle::minDimensionsBit;
|
|
||||||
ASSERT_EQ(minDimensionsBit, 54);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, aspectRatioBit) {
|
|
||||||
constexpr auto aspectRatioBit = YGStyle::aspectRatioBit;
|
|
||||||
ASSERT_EQ(aspectRatioBit, 56);
|
|
||||||
}
|
|
||||||
TEST(YGStyle, numStyles) {
|
|
||||||
constexpr auto numStyles = YGStyle::numStyles;
|
|
||||||
ASSERT_EQ(numStyles, 57);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace yoga
|
} // namespace yoga
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
112
yoga/YGStyle.h
112
yoga/YGStyle.h
@@ -7,7 +7,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <bitset>
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include "CompactValue.h"
|
#include "CompactValue.h"
|
||||||
@@ -26,12 +25,8 @@
|
|||||||
decltype(FIELD##_) get_##FIELD() const { return FIELD##_; } \
|
decltype(FIELD##_) get_##FIELD() const { return FIELD##_; } \
|
||||||
void set_##FIELD(decltype(FIELD##_) x) { FIELD##_ = x; }
|
void set_##FIELD(decltype(FIELD##_) x) { FIELD##_ = x; }
|
||||||
|
|
||||||
#define BITFIELD_REF(FIELD) \
|
#define BITFIELD_REF(FIELD) \
|
||||||
BitfieldRef< \
|
BitfieldRef<decltype(FIELD##_), &YGStyle::get_##FIELD, &YGStyle::set_##FIELD>
|
||||||
decltype(FIELD##_), \
|
|
||||||
&YGStyle::get_##FIELD, \
|
|
||||||
&YGStyle::set_##FIELD, \
|
|
||||||
FIELD##Bit>
|
|
||||||
|
|
||||||
class YGStyle {
|
class YGStyle {
|
||||||
template <typename Enum>
|
template <typename Enum>
|
||||||
@@ -39,28 +34,21 @@ class YGStyle {
|
|||||||
facebook::yoga::detail::Values<facebook::yoga::enums::count<Enum>()>;
|
facebook::yoga::detail::Values<facebook::yoga::enums::count<Enum>()>;
|
||||||
using CompactValue = facebook::yoga::detail::CompactValue;
|
using CompactValue = facebook::yoga::detail::CompactValue;
|
||||||
|
|
||||||
static constexpr uint64_t allBits(int fromBit, int toBit) {
|
|
||||||
return fromBit < toBit
|
|
||||||
? (uint64_t{1} << fromBit) | allBits(fromBit + 1, toBit)
|
|
||||||
: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using Dimensions = Values<YGDimension>;
|
using Dimensions = Values<YGDimension>;
|
||||||
using Edges = Values<YGEdge>;
|
using Edges = Values<YGEdge>;
|
||||||
|
|
||||||
template <typename T, T YGStyle::*Prop, int PropBit>
|
template <typename T, T YGStyle::*Prop>
|
||||||
struct Ref {
|
struct Ref {
|
||||||
YGStyle& style;
|
YGStyle& style;
|
||||||
operator T() const { return style.*Prop; }
|
operator T() const { return style.*Prop; }
|
||||||
Ref<T, Prop, PropBit>& operator=(T value) {
|
Ref<T, Prop>& operator=(T value) {
|
||||||
style.*Prop = value;
|
style.*Prop = value;
|
||||||
style.assignedProps_.set(PropBit);
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Idx, Values<Idx> YGStyle::*Prop, int PropBit>
|
template <typename Idx, Values<Idx> YGStyle::*Prop>
|
||||||
struct IdxRef {
|
struct IdxRef {
|
||||||
struct Ref {
|
struct Ref {
|
||||||
YGStyle& style;
|
YGStyle& style;
|
||||||
@@ -69,16 +57,13 @@ public:
|
|||||||
operator YGValue() const { return (style.*Prop)[idx]; }
|
operator YGValue() const { return (style.*Prop)[idx]; }
|
||||||
Ref& operator=(CompactValue value) {
|
Ref& operator=(CompactValue value) {
|
||||||
(style.*Prop)[idx] = value;
|
(style.*Prop)[idx] = value;
|
||||||
style.assignedProps_.set(PropBit + idx);
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
YGStyle& style;
|
YGStyle& style;
|
||||||
IdxRef<Idx, Prop, PropBit>& operator=(const Values<Idx>& values) {
|
IdxRef<Idx, Prop>& operator=(const Values<Idx>& values) {
|
||||||
style.*Prop = values;
|
style.*Prop = values;
|
||||||
style.assignedProps_ |=
|
|
||||||
allBits(PropBit, PropBit + facebook::yoga::enums::count<Idx>());
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
operator const Values<Idx>&() const { return style.*Prop; }
|
operator const Values<Idx>&() const { return style.*Prop; }
|
||||||
@@ -86,18 +71,13 @@ public:
|
|||||||
CompactValue operator[](Idx idx) const { return (style.*Prop)[idx]; }
|
CompactValue operator[](Idx idx) const { return (style.*Prop)[idx]; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <
|
template <typename T, T (YGStyle::*Get)() const, void (YGStyle::*Set)(T)>
|
||||||
typename T,
|
|
||||||
T (YGStyle::*Get)() const,
|
|
||||||
void (YGStyle::*Set)(T),
|
|
||||||
int PropBit>
|
|
||||||
struct BitfieldRef {
|
struct BitfieldRef {
|
||||||
YGStyle& style;
|
YGStyle& style;
|
||||||
|
|
||||||
operator T() const { return (style.*Get)(); }
|
operator T() const { return (style.*Get)(); }
|
||||||
BitfieldRef<T, Get, Set, PropBit>& operator=(T x) {
|
BitfieldRef<T, Get, Set>& operator=(T x) {
|
||||||
(style.*Set)(x);
|
(style.*Set)(x);
|
||||||
style.assignedProps_.set(PropBit);
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -125,41 +105,7 @@ public:
|
|||||||
|
|
||||||
~YGStyle() = default;
|
~YGStyle() = default;
|
||||||
|
|
||||||
static constexpr int directionBit = 0;
|
|
||||||
static constexpr int flexDirectionBit = directionBit + 1;
|
|
||||||
static constexpr int justifyContentBit = flexDirectionBit + 1;
|
|
||||||
static constexpr int alignContentBit = justifyContentBit + 1;
|
|
||||||
static constexpr int alignItemsBit = alignContentBit + 1;
|
|
||||||
static constexpr int alignSelfBit = alignItemsBit + 1;
|
|
||||||
static constexpr int positionTypeBit = alignSelfBit + 1;
|
|
||||||
static constexpr int flexWrapBit = positionTypeBit + 1;
|
|
||||||
static constexpr int overflowBit = flexWrapBit + 1;
|
|
||||||
static constexpr int displayBit = overflowBit + 1;
|
|
||||||
static constexpr int flexBit = displayBit + 1;
|
|
||||||
static constexpr int flexGrowBit = flexBit + 1;
|
|
||||||
static constexpr int flexShrinkBit = flexGrowBit + 1;
|
|
||||||
static constexpr int flexBasisBit = flexShrinkBit + 1;
|
|
||||||
static constexpr int marginBit = flexBasisBit + 1;
|
|
||||||
static constexpr int positionBit =
|
|
||||||
marginBit + facebook::yoga::enums::count<YGEdge>();
|
|
||||||
static constexpr int paddingBit =
|
|
||||||
positionBit + facebook::yoga::enums::count<YGEdge>();
|
|
||||||
static constexpr int borderBit =
|
|
||||||
paddingBit + facebook::yoga::enums::count<YGEdge>();
|
|
||||||
static constexpr int dimensionsBit =
|
|
||||||
borderBit + facebook::yoga::enums::count<YGEdge>();
|
|
||||||
static constexpr int maxDimensionsBit =
|
|
||||||
dimensionsBit + facebook::yoga::enums::count<YGDimension>();
|
|
||||||
static constexpr int minDimensionsBit =
|
|
||||||
maxDimensionsBit + facebook::yoga::enums::count<YGDimension>();
|
|
||||||
static constexpr int aspectRatioBit =
|
|
||||||
minDimensionsBit + facebook::yoga::enums::count<YGDimension>();
|
|
||||||
|
|
||||||
static constexpr int numStyles = aspectRatioBit + 1;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::bitset<aspectRatioBit + 1> assignedProps_;
|
|
||||||
|
|
||||||
/* Some platforms don't support enum bitfields,
|
/* Some platforms don't support enum bitfields,
|
||||||
so please use BITFIELD_ENUM_SIZED(BITS_COUNT) */
|
so please use BITFIELD_ENUM_SIZED(BITS_COUNT) */
|
||||||
YGDirection direction_ BITFIELD_ENUM_SIZED(2);
|
YGDirection direction_ BITFIELD_ENUM_SIZED(2);
|
||||||
@@ -198,10 +144,6 @@ private:
|
|||||||
BITFIELD_ACCESSORS(display);
|
BITFIELD_ACCESSORS(display);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
const decltype(assignedProps_)& assignedProps() const {
|
|
||||||
return assignedProps_;
|
|
||||||
}
|
|
||||||
|
|
||||||
// for library users needing a type
|
// for library users needing a type
|
||||||
using ValueRepr = std::remove_reference<decltype(margin_[0])>::type;
|
using ValueRepr = std::remove_reference<decltype(margin_[0])>::type;
|
||||||
|
|
||||||
@@ -236,59 +178,45 @@ public:
|
|||||||
BITFIELD_REF(display) display() { return {*this}; }
|
BITFIELD_REF(display) display() { return {*this}; }
|
||||||
|
|
||||||
YGFloatOptional flex() const { return flex_; }
|
YGFloatOptional flex() const { return flex_; }
|
||||||
Ref<YGFloatOptional, &YGStyle::flex_, flexBit> flex() { return {*this}; }
|
Ref<YGFloatOptional, &YGStyle::flex_> flex() { return {*this}; }
|
||||||
|
|
||||||
YGFloatOptional flexGrow() const { return flexGrow_; }
|
YGFloatOptional flexGrow() const { return flexGrow_; }
|
||||||
Ref<YGFloatOptional, &YGStyle::flexGrow_, flexGrowBit> flexGrow() {
|
Ref<YGFloatOptional, &YGStyle::flexGrow_> flexGrow() { return {*this}; }
|
||||||
return {*this};
|
|
||||||
}
|
|
||||||
|
|
||||||
YGFloatOptional flexShrink() const { return flexShrink_; }
|
YGFloatOptional flexShrink() const { return flexShrink_; }
|
||||||
Ref<YGFloatOptional, &YGStyle::flexShrink_, flexShrinkBit> flexShrink() {
|
Ref<YGFloatOptional, &YGStyle::flexShrink_> flexShrink() { return {*this}; }
|
||||||
return {*this};
|
|
||||||
}
|
|
||||||
|
|
||||||
CompactValue flexBasis() const { return flexBasis_; }
|
CompactValue flexBasis() const { return flexBasis_; }
|
||||||
Ref<CompactValue, &YGStyle::flexBasis_, flexBasisBit> flexBasis() {
|
Ref<CompactValue, &YGStyle::flexBasis_> flexBasis() { return {*this}; }
|
||||||
return {*this};
|
|
||||||
}
|
|
||||||
|
|
||||||
const Edges& margin() const { return margin_; }
|
const Edges& margin() const { return margin_; }
|
||||||
IdxRef<YGEdge, &YGStyle::margin_, marginBit> margin() { return {*this}; }
|
IdxRef<YGEdge, &YGStyle::margin_> margin() { return {*this}; }
|
||||||
|
|
||||||
const Edges& position() const { return position_; }
|
const Edges& position() const { return position_; }
|
||||||
IdxRef<YGEdge, &YGStyle::position_, positionBit> position() {
|
IdxRef<YGEdge, &YGStyle::position_> position() { return {*this}; }
|
||||||
return {*this};
|
|
||||||
}
|
|
||||||
|
|
||||||
const Edges& padding() const { return padding_; }
|
const Edges& padding() const { return padding_; }
|
||||||
IdxRef<YGEdge, &YGStyle::padding_, paddingBit> padding() { return {*this}; }
|
IdxRef<YGEdge, &YGStyle::padding_> padding() { return {*this}; }
|
||||||
|
|
||||||
const Edges& border() const { return border_; }
|
const Edges& border() const { return border_; }
|
||||||
IdxRef<YGEdge, &YGStyle::border_, borderBit> border() { return {*this}; }
|
IdxRef<YGEdge, &YGStyle::border_> border() { return {*this}; }
|
||||||
|
|
||||||
const Dimensions& dimensions() const { return dimensions_; }
|
const Dimensions& dimensions() const { return dimensions_; }
|
||||||
IdxRef<YGDimension, &YGStyle::dimensions_, dimensionsBit> dimensions() {
|
IdxRef<YGDimension, &YGStyle::dimensions_> dimensions() { return {*this}; }
|
||||||
return {*this};
|
|
||||||
}
|
|
||||||
|
|
||||||
const Dimensions& minDimensions() const { return minDimensions_; }
|
const Dimensions& minDimensions() const { return minDimensions_; }
|
||||||
IdxRef<YGDimension, &YGStyle::minDimensions_, minDimensionsBit>
|
IdxRef<YGDimension, &YGStyle::minDimensions_> minDimensions() {
|
||||||
minDimensions() {
|
|
||||||
return {*this};
|
return {*this};
|
||||||
}
|
}
|
||||||
|
|
||||||
const Dimensions& maxDimensions() const { return maxDimensions_; }
|
const Dimensions& maxDimensions() const { return maxDimensions_; }
|
||||||
IdxRef<YGDimension, &YGStyle::maxDimensions_, maxDimensionsBit>
|
IdxRef<YGDimension, &YGStyle::maxDimensions_> maxDimensions() {
|
||||||
maxDimensions() {
|
|
||||||
return {*this};
|
return {*this};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Yoga specific properties, not compatible with flexbox specification
|
// Yoga specific properties, not compatible with flexbox specification
|
||||||
YGFloatOptional aspectRatio() const { return aspectRatio_; }
|
YGFloatOptional aspectRatio() const { return aspectRatio_; }
|
||||||
Ref<YGFloatOptional, &YGStyle::aspectRatio_, aspectRatioBit> aspectRatio() {
|
Ref<YGFloatOptional, &YGStyle::aspectRatio_> aspectRatio() { return {*this}; }
|
||||||
return {*this};
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bool operator==(const YGStyle& lhs, const YGStyle& rhs);
|
bool operator==(const YGStyle& lhs, const YGStyle& rhs);
|
||||||
|
Reference in New Issue
Block a user