Optimise level indicator archiving (don't record static background colour).

This commit is contained in:
Alexander Ljungberg
2011-05-30 00:03:12 -04:00
parent 8fdcbac2bd
commit 2b8fa11b84
+4
View File
@@ -370,7 +370,11 @@ var CPLevelIndicatorStyleKey = "CPLevelIndicatorStyleKey",
- (void)encodeWithCoder:(CPCoder)aCoder
{
// There's no reason to encode the background.
var background = [self backgroundColor];
[self setBackgroundColor:nil];
[super encodeWithCoder:aCoder];
[self setBackgroundColor:background];
[aCoder encodeInt:_levelIndicatorStyle forKey:CPLevelIndicatorStyleKey];
[aCoder encodeDouble:_minValue forKey:CPLevelIndicatorMinValueKey];