[ASDisplayNode] Ensure display is triggered properly even before layers are onscreen (in display range).

This commit is contained in:
Scott Goodson
2016-02-29 00:46:45 -08:00
parent 875ce9fc7b
commit 5e35ef7938

View File

@@ -321,12 +321,7 @@ if (shouldApply) { _layer.layerProperty = (layerValueExpr); } else { ASDisplayNo
// which may call -displayIfNeeded. We want to ensure the needsDisplay flag is set now, and then cleared.
_messageToViewOrLayer(setNeedsDisplay);
} else {
if (__loaded(self)) {
// In this case, the node is loaded but we are on a background thread. Apply setNeedsDisplay so it is communicated
// to the backing view / layer in the next main thread flush. If the view / layer are not loaded, then
// Core Animation automatically considers them as "needsDisplay" if applicable when they are added to the hierarchy.
[ASDisplayNodeGetPendingState(self) setNeedsDisplay];
}
[ASDisplayNodeGetPendingState(self) setNeedsDisplay];
}
[self __setNeedsDisplay];
}