mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
BREAKING - Change measure() api to remove need for MeasureOutput allocation
Reviewed By: splhack Differential Revision: D4081037 fbshipit-source-id: 28adbcdd160cbd3f59a0fdd4b9f1200ae18678f1
This commit is contained in:
committed by
Facebook Github Bot
parent
bafc6ddbd1
commit
553f4371e0
@@ -560,22 +560,23 @@ public class LayoutEngine {
|
||||
} else {
|
||||
|
||||
// Measure the text under the current constraints.
|
||||
MeasureOutput measureDim = node.measure(
|
||||
|
||||
layoutContext.measureOutput,
|
||||
long measureOutput = node.measure(
|
||||
innerWidth,
|
||||
widthMeasureMode,
|
||||
innerHeight,
|
||||
heightMeasureMode
|
||||
);
|
||||
|
||||
int outputWidth = MeasureOutput.getWidth(measureOutput);
|
||||
int outputHeight = MeasureOutput.getHeight(measureOutput);
|
||||
|
||||
node.layout.measuredDimensions[DIMENSION_WIDTH] = boundAxis(node, CSS_FLEX_DIRECTION_ROW,
|
||||
(widthMeasureMode == CSSMeasureMode.UNDEFINED || widthMeasureMode == CSSMeasureMode.AT_MOST) ?
|
||||
measureDim.width + paddingAndBorderAxisRow :
|
||||
outputWidth + paddingAndBorderAxisRow :
|
||||
availableWidth - marginAxisRow);
|
||||
node.layout.measuredDimensions[DIMENSION_HEIGHT] = boundAxis(node, CSS_FLEX_DIRECTION_COLUMN,
|
||||
(heightMeasureMode == CSSMeasureMode.UNDEFINED || heightMeasureMode == CSSMeasureMode.AT_MOST) ?
|
||||
measureDim.height + paddingAndBorderAxisColumn :
|
||||
outputHeight + paddingAndBorderAxisColumn :
|
||||
availableHeight - marginAxisColumn);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user