mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-16 19:30:29 +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
|
- (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.
|
// 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
|
// 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)) {
|
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);
|
LOG(@"Warning: No size given for node before node was trying to layout itself: %@. Please provide a frame for the node.", self);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user