diff --git a/Source/ASImageNode.mm b/Source/ASImageNode.mm index 5dd5c32a6..e2ddb8c3c 100644 --- a/Source/ASImageNode.mm +++ b/Source/ASImageNode.mm @@ -179,7 +179,6 @@ - (instancetype)init _imageNodeFlags.cropEnabled = YES; _imageNodeFlags.forceUpscaling = NO; - _imageNodeFlags.regenerateFromImageAsset = NO; _cropRect = CGRectMake(0.5, 0.5, 0, 0); _cropDisplayBounds = CGRectNull; _placeholderColor = ASDisplayNodeDefaultPlaceholderColor(); @@ -292,8 +291,7 @@ - (NSObject *)drawParametersForAsyncLayer:(_ASDisplayLayer *)layer { ASLockScopeSelf(); UIImage *drawImage = _image; - if (_imageNodeFlags.regenerateFromImageAsset && drawImage != nil) { - _imageNodeFlags.regenerateFromImageAsset = NO; + if (drawImage != nil && drawImage.imageAsset != nil) { UITraitCollection *tc = [UITraitCollection traitCollectionWithUserInterfaceStyle:_primitiveTraitCollection.userInterfaceStyle]; UIImage *generatedImage = [drawImage.imageAsset imageWithTraitCollection:tc]; if ( generatedImage != nil ) { @@ -770,19 +768,6 @@ - (NSDictionary *)debugLabelAttributes }; } -- (void)asyncTraitCollectionDidChangeWithPreviousTraitCollection:(ASPrimitiveTraitCollection)previousTraitCollection { - [super asyncTraitCollectionDidChangeWithPreviousTraitCollection:previousTraitCollection]; - - { - AS::MutexLocker l(__instanceLock__); - // update image if userInterfaceStyle was changed (dark mode) - if (_image != nil - && _primitiveTraitCollection.userInterfaceStyle != previousTraitCollection.userInterfaceStyle) { - _imageNodeFlags.regenerateFromImageAsset = YES; - } - } -} - @end diff --git a/Source/Private/ASImageNode+AnimatedImagePrivate.h b/Source/Private/ASImageNode+AnimatedImagePrivate.h index 917eb6fbb..e41ba34e3 100644 --- a/Source/Private/ASImageNode+AnimatedImagePrivate.h +++ b/Source/Private/ASImageNode+AnimatedImagePrivate.h @@ -28,7 +28,6 @@ unsigned int animatedImagePaused:1; unsigned int cropEnabled:1; // Defaults to YES. unsigned int forceUpscaling:1; //Defaults to NO. - unsigned int regenerateFromImageAsset:1; //Defaults to NO. } _imageNodeFlags; }