@@ -434,7 +434,7 @@ inline float YGNodeStyleGetFlexShrink(const YGNodeRef node) {
434434}
435435
436436static inline const YGValue * YGNodeStyleGetFlexBasisPtr (const YGNodeRef node ) {
437- if (node -> style .flexBasis .unit != YGUnitAuto ) {
437+ if (node -> style .flexBasis .unit != YGUnitAuto && node -> style . flexBasis . unit != YGUnitUndefined ) {
438438 return & node -> style .flexBasis ;
439439 }
440440 if (!YGFloatIsUndefined (node -> style .flex ) && node -> style .flex > 0.0f ) {
@@ -477,7 +477,7 @@ void YGNodeStyleSetFlex(const YGNodeRef node, const float flex) {
477477 node->style.instanceName.unit != YGUnitPoint) { \
478478 node->style.instanceName.value = paramName; \
479479 node->style.instanceName.unit = \
480- YGFloatIsUndefined(paramName) ? YGUnitUndefined : YGUnitPoint; \
480+ YGFloatIsUndefined(paramName) ? YGUnitAuto : YGUnitPoint; \
481481 YGNodeMarkDirtyInternal(node); \
482482 } \
483483 } \
@@ -487,7 +487,7 @@ void YGNodeStyleSetFlex(const YGNodeRef node, const float flex) {
487487 node->style.instanceName.unit != YGUnitPercent) { \
488488 node->style.instanceName.value = paramName; \
489489 node->style.instanceName.unit = \
490- YGFloatIsUndefined(paramName) ? YGUnitUndefined : YGUnitPercent; \
490+ YGFloatIsUndefined(paramName) ? YGUnitAuto : YGUnitPercent; \
491491 YGNodeMarkDirtyInternal(node); \
492492 } \
493493 }
@@ -496,7 +496,7 @@ void YGNodeStyleSetFlex(const YGNodeRef node, const float flex) {
496496 void YGNodeStyleSet##name(const YGNodeRef node, const type paramName) { \
497497 if (node->style.instanceName.value != paramName || \
498498 node->style.instanceName.unit != YGUnitPoint) { \
499- node->style.instanceName.value = YGFloatIsUndefined( paramName) ? YGUndefined : paramName; \
499+ node->style.instanceName.value = paramName; \
500500 node->style.instanceName.unit = YGFloatIsUndefined(paramName) ? YGUnitAuto : YGUnitPoint; \
501501 YGNodeMarkDirtyInternal(node); \
502502 } \
@@ -505,7 +505,7 @@ void YGNodeStyleSetFlex(const YGNodeRef node, const float flex) {
505505 void YGNodeStyleSet##name##Percent(const YGNodeRef node, const type paramName) { \
506506 if (node->style.instanceName.value != paramName || \
507507 node->style.instanceName.unit != YGUnitPercent) { \
508- node->style.instanceName.value = YGFloatIsUndefined( paramName) ? YGUndefined : paramName; \
508+ node->style.instanceName.value = paramName; \
509509 node->style.instanceName.unit = YGFloatIsUndefined(paramName) ? YGUnitAuto : YGUnitPercent; \
510510 YGNodeMarkDirtyInternal(node); \
511511 } \
0 commit comments