From a0805d0b90e3a60704552dae080ded106758f266 Mon Sep 17 00:00:00 2001 From: Emil Sjolander Date: Mon, 1 Aug 2016 05:24:18 -0700 Subject: [PATCH] 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 --- CSSLayout/CSSLayout-internal.h | 2 +- CSSLayout/CSSLayout.c | 6 +++--- CSSLayout/CSSLayout.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CSSLayout/CSSLayout-internal.h b/CSSLayout/CSSLayout-internal.h index ec0e5fb3..6c13397f 100644 --- a/CSSLayout/CSSLayout-internal.h +++ b/CSSLayout/CSSLayout-internal.h @@ -87,7 +87,7 @@ typedef struct CSSNode { CSSStyle style; CSSLayout layout; int lineIndex; - bool shouldUpdate; + bool hasNewLayout; bool isTextNode; CSSNodeRef parent; CSSNodeListRef children; diff --git a/CSSLayout/CSSLayout.c b/CSSLayout/CSSLayout.c index 37ad5c7e..8c280d9f 100644 --- a/CSSLayout/CSSLayout.c +++ b/CSSLayout/CSSLayout.c @@ -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; } diff --git a/CSSLayout/CSSLayout.h b/CSSLayout/CSSLayout.h index 7babbd81..d39c2d90 100644 --- a/CSSLayout/CSSLayout.h +++ b/CSSLayout/CSSLayout.h @@ -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);