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:
committed by
Facebook Github Bot 3
parent
5207b90420
commit
a0805d0b90
@@ -87,7 +87,7 @@ typedef struct CSSNode {
|
|||||||
CSSStyle style;
|
CSSStyle style;
|
||||||
CSSLayout layout;
|
CSSLayout layout;
|
||||||
int lineIndex;
|
int lineIndex;
|
||||||
bool shouldUpdate;
|
bool hasNewLayout;
|
||||||
bool isTextNode;
|
bool isTextNode;
|
||||||
CSSNodeRef parent;
|
CSSNodeRef parent;
|
||||||
CSSNodeListRef children;
|
CSSNodeListRef children;
|
||||||
|
@@ -45,7 +45,7 @@ void CSSNodeFree(CSSNodeRef node) {
|
|||||||
void CSSNodeInit(CSSNodeRef node) {
|
void CSSNodeInit(CSSNodeRef node) {
|
||||||
node->parent = NULL;
|
node->parent = NULL;
|
||||||
node->children = CSSNodeListNew(4);
|
node->children = CSSNodeListNew(4);
|
||||||
node->shouldUpdate = true;
|
node->hasNewLayout = true;
|
||||||
node->isDirty = false;
|
node->isDirty = false;
|
||||||
|
|
||||||
node->style.alignItems = CSSAlignStretch;
|
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(CSSMeasureFunc, MeasureFunc, measureFunc, measure);
|
||||||
CSS_NODE_PROPERTY_IMPL(CSSPrintFunc, PrintFunc, printFunc, print);
|
CSS_NODE_PROPERTY_IMPL(CSSPrintFunc, PrintFunc, printFunc, print);
|
||||||
CSS_NODE_PROPERTY_IMPL(bool, IsTextnode, isTextNode, isTextNode);
|
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(CSSDirection, Direction, direction, direction);
|
||||||
CSS_NODE_STYLE_PROPERTY_IMPL(CSSFlexDirection, FlexDirection, flexDirection, flexDirection);
|
CSS_NODE_STYLE_PROPERTY_IMPL(CSSFlexDirection, FlexDirection, flexDirection, flexDirection);
|
||||||
@@ -1910,7 +1910,7 @@ bool layoutNodeInternal(CSSNode* node, float availableWidth, float availableHeig
|
|||||||
if (performLayout) {
|
if (performLayout) {
|
||||||
node->layout.dimensions[CSSDimensionWidth] = node->layout.measuredDimensions[CSSDimensionWidth];
|
node->layout.dimensions[CSSDimensionWidth] = node->layout.measuredDimensions[CSSDimensionWidth];
|
||||||
node->layout.dimensions[CSSDimensionHeight] = node->layout.measuredDimensions[CSSDimensionHeight];
|
node->layout.dimensions[CSSDimensionHeight] = node->layout.measuredDimensions[CSSDimensionHeight];
|
||||||
node->shouldUpdate = true;
|
node->hasNewLayout = true;
|
||||||
node->isDirty = false;
|
node->isDirty = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -152,7 +152,7 @@ CSS_NODE_PROPERTY(void*, Context, context);
|
|||||||
CSS_NODE_PROPERTY(CSSMeasureFunc, MeasureFunc, measureFunc);
|
CSS_NODE_PROPERTY(CSSMeasureFunc, MeasureFunc, measureFunc);
|
||||||
CSS_NODE_PROPERTY(CSSPrintFunc, PrintFunc, printFunc);
|
CSS_NODE_PROPERTY(CSSPrintFunc, PrintFunc, printFunc);
|
||||||
CSS_NODE_PROPERTY(bool, IsTextnode, isTextNode);
|
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(CSSDirection, Direction, direction);
|
||||||
CSS_NODE_STYLE_PROPERTY(CSSFlexDirection, FlexDirection, flexDirection);
|
CSS_NODE_STYLE_PROPERTY(CSSFlexDirection, FlexDirection, flexDirection);
|
||||||
|
Reference in New Issue
Block a user