react-native-fast-image 8.6.13 → 8.6.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
@property(nonatomic, assign) BOOL needsReload;
|
|
12
12
|
|
|
13
13
|
@property(nonatomic, strong) NSDictionary* onLoadEvent;
|
|
14
|
+
// The image before tinting, kept while a tint is applied so the tint can be
|
|
15
|
+
// changed or removed. nil when there's no tint (super.image is untinted).
|
|
16
|
+
@property(nonatomic, strong) UIImage* untintedImage;
|
|
14
17
|
|
|
15
18
|
@end
|
|
16
19
|
|
|
@@ -63,11 +66,11 @@
|
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
- (void) setImageColor: (UIColor*)imageColor {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
_imageColor = imageColor;
|
|
70
|
+
// Re-apply to the untinted image, so the tint can change or be removed.
|
|
71
|
+
UIImage* image = self.untintedImage ?: super.image;
|
|
72
|
+
if (image) {
|
|
73
|
+
[self setImage: image];
|
|
71
74
|
}
|
|
72
75
|
}
|
|
73
76
|
|
|
@@ -110,8 +113,10 @@
|
|
|
110
113
|
|
|
111
114
|
- (void) setImage: (UIImage*)image {
|
|
112
115
|
if (self.imageColor != nil) {
|
|
116
|
+
self.untintedImage = image;
|
|
113
117
|
super.image = [self makeImage: image withTint: self.imageColor];
|
|
114
118
|
} else {
|
|
119
|
+
self.untintedImage = nil;
|
|
115
120
|
super.image = image;
|
|
116
121
|
}
|
|
117
122
|
}
|