mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-06 13:12:49 +00:00
Merge pull request #1902 from maicki/MSFixLayoutTriggerFromSubnodeNotHappening
[ASDisplayNode] Fix setNeedsLayout triggered from subnode will not trigger relayout
This commit is contained in:
@@ -1055,13 +1055,15 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c)
|
||||
- (void)__setNeedsLayout
|
||||
{
|
||||
ASDisplayNodeAssertThreadAffinity(self);
|
||||
|
||||
_propertyLock.lock();
|
||||
|
||||
if ([self _hasDirtyLayout]) {
|
||||
if (_layout == nil) {
|
||||
// Can't proceed without a layout as no constrained size would be available
|
||||
_propertyLock.unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
[self invalidateCalculatedLayout];
|
||||
|
||||
if (_supernode) {
|
||||
@@ -1091,6 +1093,7 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c)
|
||||
CGFloat yDelta = (newSize.height - oldSize.height) * anchorPoint.y;
|
||||
self.position = CGPointMake(oldPosition.x + xDelta, oldPosition.y + yDelta);
|
||||
}
|
||||
|
||||
_propertyLock.unlock();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user