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:
David Aurelio 2018-08-17 03:56:43 -07:00 committed by Facebook Github Bot
parent 03377ac322
commit e4dc34ddba
1 changed files with 2 additions and 10 deletions

View File

@ -648,16 +648,8 @@ struct DimensionProp {
\
void YGNodeStyleSet##name##Percent( \
const YGNodeRef node, const type paramName) { \
YGValue value = { \
YGFloatSanitize(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(); \
} \
DimensionProp<&YGStyle::instanceName>::set<dimension, YGUnitPercent>( \
node, paramName); \
}
#define YG_NODE_STYLE_PROPERTY_SETTER_UNIT_AUTO_IMPL( \