fix missing invalidation if owner has undefinied dims
This commit is contained in:
@@ -38,6 +38,9 @@ public:
|
||||
uint32_t generationCount = 0;
|
||||
YGDirection lastOwnerDirection = YGDirectionInherit;
|
||||
|
||||
bool lastOwnerHadUndefinedHeight = false;
|
||||
bool lastOwnerHadUndefinedWidth = false;
|
||||
|
||||
uint32_t nextCachedMeasurementsIndex = 0;
|
||||
std::array<YGCachedMeasurement, YG_MAX_CACHED_RESULT_COUNT>
|
||||
cachedMeasurements = {};
|
||||
|
@@ -3811,9 +3811,14 @@ bool YGLayoutNodeInternal(
|
||||
|
||||
depth++;
|
||||
|
||||
bool ownerHasUndefinedHeight = YGFloatIsUndefined(ownerHeight);
|
||||
bool ownerHasUndefinedWidth = YGFloatIsUndefined(ownerWidth);
|
||||
|
||||
const bool needToVisitNode =
|
||||
(node->isDirty() && layout->generationCount != generationCount) ||
|
||||
layout->lastOwnerDirection != ownerDirection;
|
||||
layout->lastOwnerDirection != ownerDirection ||
|
||||
layout->lastOwnerHadUndefinedHeight != ownerHasUndefinedHeight||
|
||||
layout->lastOwnerHadUndefinedWidth != ownerHasUndefinedWidth;
|
||||
|
||||
if (needToVisitNode) {
|
||||
// Invalidate the cached results.
|
||||
@@ -3995,6 +4000,8 @@ bool YGLayoutNodeInternal(
|
||||
}
|
||||
|
||||
layout->lastOwnerDirection = ownerDirection;
|
||||
layout->lastOwnerHadUndefinedHeight = ownerHasUndefinedHeight;
|
||||
layout->lastOwnerHadUndefinedWidth = ownerHasUndefinedWidth;
|
||||
|
||||
if (cachedResults == nullptr) {
|
||||
if (layout->nextCachedMeasurementsIndex + 1 >
|
||||
|
Reference in New Issue
Block a user