mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 17:54:48 +00:00
Allow MeasureFunc to be set to NULL no matter how many children a node has.
Reviewed By: emilsjolander Differential Revision: D4148727 fbshipit-source-id: 79a0f3ef1bf7b1dce9a14de96f870e35c042b78b
This commit is contained in:
parent
ef31c68911
commit
39798ae368
@ -259,8 +259,13 @@ static void _CSSNodeMarkDirty(const CSSNodeRef node) {
|
||||
}
|
||||
|
||||
void CSSNodeSetMeasureFunc(const CSSNodeRef node, CSSMeasureFunc measureFunc) {
|
||||
CSS_ASSERT(CSSNodeChildCount(node) == 0, "Cannot set measure function: Nodes with measure functions cannot have children.");
|
||||
node->measure = measureFunc;
|
||||
// You can always NULLify the measure function of a node.
|
||||
if (measureFunc == NULL) {
|
||||
node->measure = NULL;
|
||||
} else {
|
||||
CSS_ASSERT(CSSNodeChildCount(node) == 0, "Cannot set measure function: Nodes with measure functions cannot have children.");
|
||||
node->measure = measureFunc;
|
||||
}
|
||||
}
|
||||
|
||||
CSSMeasureFunc CSSNodeGetMeasureFunc(const CSSNodeRef node) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user