shouldUpdate -> hasNewLayout

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 2
parent 5cf7f040a5
commit 42fc2e80db
4 changed files with 7 additions and 7 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);

View File

@ -137,10 +137,10 @@ DEFINE_PROCESS_META_PROPS(Border);
viewsWithNewFrame:(NSMutableSet<RCTShadowView *> *)viewsWithNewFrame
absolutePosition:(CGPoint)absolutePosition
{
if (!CSSNodeGetShouldUpdate(node)) {
if (!CSSNodeGetHasNewLayout(node)) {
return;
}
CSSNodeSetShouldUpdate(node, false);
CSSNodeSetHasNewLayout(node, false);
CGPoint absoluteTopLeft = {
absolutePosition.x + CSSNodeLayoutGetLeft(node),