|
14 | 14 |
|
15 | 15 | struct YGNode { |
16 | 16 | private: |
17 | | - void* context_; |
18 | | - YGPrintFunc print_; |
19 | | - bool hasNewLayout_; |
20 | | - YGNodeType nodeType_; |
21 | | - YGMeasureFunc measure_; |
22 | | - YGBaselineFunc baseline_; |
23 | | - YGDirtiedFunc dirtied_; |
24 | | - YGStyle style_; |
25 | | - YGLayout layout_; |
26 | | - uint32_t lineIndex_; |
27 | | - YGNodeRef owner_; |
28 | | - YGVector children_; |
29 | | - YGConfigRef config_; |
30 | | - bool isDirty_; |
31 | | - std::array<YGValue, 2> resolvedDimensions_; |
| 17 | + void* context_ = nullptr; |
| 18 | + YGPrintFunc print_ = nullptr; |
| 19 | + bool hasNewLayout_ = true; |
| 20 | + YGNodeType nodeType_ = YGNodeTypeDefault; |
| 21 | + YGMeasureFunc measure_ = nullptr; |
| 22 | + YGBaselineFunc baseline_ = nullptr; |
| 23 | + YGDirtiedFunc dirtied_ = nullptr; |
| 24 | + YGStyle style_ = {}; |
| 25 | + YGLayout layout_ = {}; |
| 26 | + uint32_t lineIndex_ = 0; |
| 27 | + YGNodeRef owner_ = nullptr; |
| 28 | + YGVector children_ = {}; |
| 29 | + YGConfigRef config_ = nullptr; |
| 30 | + bool isDirty_ = false; |
| 31 | + std::array<YGValue, 2> resolvedDimensions_ = { |
| 32 | + {YGValueUndefined, YGValueUndefined}}; |
32 | 33 |
|
33 | 34 | YGFloatOptional relativePosition( |
34 | 35 | const YGFlexDirection& axis, |
35 | 36 | const float& axisSize) const; |
36 | 37 |
|
37 | 38 | public: |
38 | | - YGNode(); |
39 | | - ~YGNode(); |
40 | | - explicit YGNode(const YGConfigRef newConfig); |
41 | | - YGNode(const YGNode& node); |
| 39 | + YGNode() = default; |
| 40 | + ~YGNode() = default; // cleanup of owner/children relationships in YGNodeFree |
| 41 | + explicit YGNode(const YGConfigRef newConfig) : config_(newConfig){}; |
| 42 | + YGNode(const YGNode& node) = default; |
42 | 43 | YGNode& operator=(const YGNode& node); |
43 | 44 |
|
44 | 45 | // Getters |
|
0 commit comments