Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

[ASDisplayNode] Fix setNeedsLayout triggered from subnode will not trigger relayout #1902

Merged
merged 1 commit into from
Jul 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions AsyncDisplayKit/ASDisplayNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1055,13 +1055,15 @@ - (void)recursivelyDisplayImmediately
- (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) {
Expand Down Expand Up @@ -1091,6 +1093,7 @@ - (void)__setNeedsLayout
CGFloat yDelta = (newSize.height - oldSize.height) * anchorPoint.y;
self.position = CGPointMake(oldPosition.x + xDelta, oldPosition.y + yDelta);
}

_propertyLock.unlock();
}

Expand Down