Replace percent setter in `YG_NODE_STYLE_PROPERTY_UNIT_IMPL` macro with template code
Reviewed By: astreet Differential Revision: D8874732 fbshipit-source-id: 46fdf851f19f16def0c7e2ab4c5f17a349dc7aee
This commit is contained in:
parent
03377ac322
commit
e4dc34ddba
|
@ -648,16 +648,8 @@ struct DimensionProp {
|
||||||
\
|
\
|
||||||
void YGNodeStyleSet##name##Percent( \
|
void YGNodeStyleSet##name##Percent( \
|
||||||
const YGNodeRef node, const type paramName) { \
|
const YGNodeRef node, const type paramName) { \
|
||||||
YGValue value = { \
|
DimensionProp<&YGStyle::instanceName>::set<dimension, YGUnitPercent>( \
|
||||||
YGFloatSanitize(paramName), \
|
node, paramName); \
|
||||||
YGFloatIsUndefined(paramName) ? YGUnitUndefined : YGUnitPercent, \
|
|
||||||
}; \
|
|
||||||
if ((node->getStyle().instanceName[dimension].value != value.value && \
|
|
||||||
value.unit != YGUnitUndefined) || \
|
|
||||||
node->getStyle().instanceName[dimension].unit != value.unit) { \
|
|
||||||
node->getStyle().instanceName[dimension] = value; \
|
|
||||||
node->markDirtyAndPropogate(); \
|
|
||||||
} \
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define YG_NODE_STYLE_PROPERTY_SETTER_UNIT_AUTO_IMPL( \
|
#define YG_NODE_STYLE_PROPERTY_SETTER_UNIT_AUTO_IMPL( \
|
||||||
|
|
Loading…
Reference in New Issue