From 294229e4ac642c6e62e6256446b8ec0ee5375f2d Mon Sep 17 00:00:00 2001 From: Vlad Solomenchuk Date: Thu, 20 Feb 2020 13:11:12 -0800 Subject: [PATCH] resolve background color using system trait collection --- Source/ASDisplayNode.mm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index afa39b224..c9495389f 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -453,11 +453,10 @@ - (void)asyncTraitCollectionDidChangeWithPreviousTraitCollection:(ASPrimitiveTra CGFloat cornerRadius = _cornerRadius; ASCornerRoundingType cornerRoundingType = _cornerRoundingType; UIColor *backgroundColor = _backgroundColor; - ASPrimitiveTraitCollection primitiveTraitCollection = _primitiveTraitCollection; __instanceLock__.unlock(); - UITraitCollection *traitCollection = ASPrimitiveTraitCollectionToUITraitCollection(primitiveTraitCollection); - UIColor *resolvedBackgroundColor = [backgroundColor resolvedColorWithTraitCollection:traitCollection]; - CGColorRef cgBackgroundColor = resolvedBackgroundColor.CGColor; + // TODO: we should resolve color using node's trait collection + // but Texture changes it from many places, so we may receive the wrong one. + CGColorRef cgBackgroundColor = backgroundColor.CGColor; if (!CGColorEqualToColor(_layer.backgroundColor, cgBackgroundColor)) { // Background colors do not dynamically update for layer backed nodes since they utilize CGColorRef // instead of UIColor. Non layer backed node also receive color to the layer (see [_ASPendingState -applyToView:withSpecialPropertiesHandling:]).