Added default constructor for YGCachedMeasurement

Reviewed By: emilsjolander

Differential Revision: D7020337

fbshipit-source-id: e084e234bf6a2ae22e53e739959683abca169b88
This commit is contained in:
Pritesh Nandgaonkar 2018-02-20 05:41:52 -08:00 committed by Facebook Github Bot
parent c75ce8146f
commit 22cf81571b
2 changed files with 9 additions and 8 deletions

View File

@ -26,14 +26,7 @@ YGLayout::YGLayout()
nextCachedMeasurementsIndex(0),
cachedMeasurements(),
measuredDimensions(kYGDefaultDimensionValues),
cachedLayout({
.availableWidth = 0,
.availableHeight = 0,
.widthMeasureMode = (YGMeasureMode)-1,
.heightMeasureMode = (YGMeasureMode)-1,
.computedWidth = -1,
.computedHeight = -1,
}),
cachedLayout(YGCachedMeasurement()),
didUseLegacyFlag(false),
doesLegacyStretchFlagAffectsLayout(false) {}

View File

@ -50,6 +50,14 @@ struct YGCachedMeasurement {
float computedWidth;
float computedHeight;
YGCachedMeasurement()
: availableWidth(0),
availableHeight(0),
widthMeasureMode((YGMeasureMode)-1),
heightMeasureMode((YGMeasureMode)-1),
computedWidth(-1),
computedHeight(-1) {}
bool operator==(YGCachedMeasurement measurement) const {
bool isEqual = widthMeasureMode == measurement.widthMeasureMode &&
heightMeasureMode == measurement.heightMeasureMode;