shouldUpdate -> hasNewLayout

Summary: This moves the api in line with the java api. hasNewLayout makes for sense than shouldUpdate because the API is not telling css layout to update but is instead just a marker for the user of the API to know if there has been a new layout since last time it checked.

Reviewed By: majak

Differential Revision: D3613695

fbshipit-source-id: 4e16e8d4de90660a09d6e1d3a43c6c5e89349993
This commit is contained in:
Emil Sjolander
2016-08-01 05:24:18 -07:00
committed by Facebook Github Bot 3
parent 5207b90420
commit a0805d0b90
3 changed files with 5 additions and 5 deletions

View File

@@ -87,7 +87,7 @@ typedef struct CSSNode {
CSSStyle style;
CSSLayout layout;
int lineIndex;
bool shouldUpdate;
bool hasNewLayout;
bool isTextNode;
CSSNodeRef parent;
CSSNodeListRef children;

View File

@@ -45,7 +45,7 @@ void CSSNodeFree(CSSNodeRef node) {
void CSSNodeInit(CSSNodeRef node) {
node->parent = NULL;
node->children = CSSNodeListNew(4);
node->shouldUpdate = true;
node->hasNewLayout = true;
node->isDirty = false;
node->style.alignItems = CSSAlignStretch;
@@ -158,7 +158,7 @@ CSS_NODE_PROPERTY_IMPL(void*, Context, context, context);
CSS_NODE_PROPERTY_IMPL(CSSMeasureFunc, MeasureFunc, measureFunc, measure);
CSS_NODE_PROPERTY_IMPL(CSSPrintFunc, PrintFunc, printFunc, print);
CSS_NODE_PROPERTY_IMPL(bool, IsTextnode, isTextNode, isTextNode);
CSS_NODE_PROPERTY_IMPL(bool, ShouldUpdate, shouldUpdate, shouldUpdate);
CSS_NODE_PROPERTY_IMPL(bool, HasNewLayout, hasNewLayout, hasNewLayout);
CSS_NODE_STYLE_PROPERTY_IMPL(CSSDirection, Direction, direction, direction);
CSS_NODE_STYLE_PROPERTY_IMPL(CSSFlexDirection, FlexDirection, flexDirection, flexDirection);
@@ -1910,7 +1910,7 @@ bool layoutNodeInternal(CSSNode* node, float availableWidth, float availableHeig
if (performLayout) {
node->layout.dimensions[CSSDimensionWidth] = node->layout.measuredDimensions[CSSDimensionWidth];
node->layout.dimensions[CSSDimensionHeight] = node->layout.measuredDimensions[CSSDimensionHeight];
node->shouldUpdate = true;
node->hasNewLayout = true;
node->isDirty = false;
}

View File

@@ -152,7 +152,7 @@ CSS_NODE_PROPERTY(void*, Context, context);
CSS_NODE_PROPERTY(CSSMeasureFunc, MeasureFunc, measureFunc);
CSS_NODE_PROPERTY(CSSPrintFunc, PrintFunc, printFunc);
CSS_NODE_PROPERTY(bool, IsTextnode, isTextNode);
CSS_NODE_PROPERTY(bool, ShouldUpdate, shouldUpdate);
CSS_NODE_PROPERTY(bool, HasNewLayout, hasNewLayout);
CSS_NODE_STYLE_PROPERTY(CSSDirection, Direction, direction);
CSS_NODE_STYLE_PROPERTY(CSSFlexDirection, FlexDirection, flexDirection);