Dont measure single flex grow+shrink child
Summary: If there is a single child which is flex grow and flex shrink then instead of measuring and then shrinking we can just set the flex basis to zero as we know the final result will be that the child take up all remaining space. Reviewed By: gkassabli Differential Revision: D4147298 fbshipit-source-id: 51152e57eff8e322a833a6d698c30f8c5e2dcc35
This commit is contained in:
committed by
Facebook Github Bot
parent
3e567fdcae
commit
12ebaa56b6
@@ -17,7 +17,8 @@ static CSSSize _measureMax(CSSNodeRef node,
|
||||
CSSMeasureMode heightMode) {
|
||||
|
||||
int *measureCount = (int *)CSSNodeGetContext(node);
|
||||
*measureCount = *measureCount + 1;
|
||||
(*measureCount)++;
|
||||
|
||||
return CSSSize {
|
||||
.width = widthMode == CSSMeasureModeUndefined ? 10 : width,
|
||||
.height = heightMode == CSSMeasureModeUndefined ? 10 : height,
|
||||
|
Reference in New Issue
Block a user