mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-15 18:59:54 +00:00
Grab propertyLock to get supportsRangeManagedInterfaceState and for asking dirty layout status
This commit is contained in:
parent
20a49f037b
commit
fcfce5128d
@ -1135,9 +1135,19 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c)
|
||||
|
||||
- (void)measureNodeWithBoundsIfNecessary:(CGRect)bounds
|
||||
{
|
||||
BOOL supportsRangedManagedInterfaceState = NO;
|
||||
BOOL hasDirtyLayout = NO;
|
||||
BOOL hasSupernode = NO;
|
||||
{
|
||||
ASDN::MutexLocker l(_propertyLock);
|
||||
supportsRangedManagedInterfaceState = [self supportsRangeManagedInterfaceState];
|
||||
hasDirtyLayout = [self _hasDirtyLayout];
|
||||
hasSupernode = (self.supernode != nil);
|
||||
}
|
||||
|
||||
// Normally measure will be called before layout occurs. If this doesn't happen, nothing is going to call it at all.
|
||||
// We simply call measureWithSizeRange: using a size range equal to whatever bounds were provided to that element
|
||||
if (self.supernode == nil && !self.supportsRangeManagedInterfaceState && [self _hasDirtyLayout]) {
|
||||
if (!hasSupernode && !supportsRangedManagedInterfaceState && hasDirtyLayout) {
|
||||
if (CGRectEqualToRect(bounds, CGRectZero)) {
|
||||
LOG(@"Warning: No size given for node before node was trying to layout itself: %@. Please provide a frame for the node.", self);
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user