mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-30 00:02:47 +00:00
recents_swipe_actions2
-> MXKTools::resizeImage instead of a local method.
This commit is contained in:
parent
c8fe9d6d20
commit
9880bd2224
1 changed files with 1 additions and 10 deletions
|
@ -319,15 +319,6 @@
|
|||
}
|
||||
|
||||
#pragma mark - swipe actions
|
||||
|
||||
- (UIImage *)imageWithImage:(UIImage *)image scaledToSize:(CGSize)newSize {
|
||||
UIGraphicsBeginImageContextWithOptions(newSize, NO, 0.0);
|
||||
[image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
|
||||
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
|
||||
UIGraphicsEndImageContext();
|
||||
return newImage;
|
||||
}
|
||||
|
||||
static NSMutableDictionary* backgroundByImageNameDict;
|
||||
|
||||
- (UIColor*)getBackgroundColor:(NSString*)imageName
|
||||
|
@ -346,7 +337,7 @@ static NSMutableDictionary* backgroundByImageNameDict;
|
|||
|
||||
if (!bgColor)
|
||||
{
|
||||
bgColor = [[UIColor alloc] initWithPatternImage:[self imageWithImage:[UIImage imageNamed:imageName] scaledToSize:CGSizeMake(74, 74)]];
|
||||
bgColor = [[UIColor alloc] initWithPatternImage:[MXKTools resizeImage:[UIImage imageNamed:imageName] toFitInSize:CGSizeMake(74, 74)]];
|
||||
[backgroundByImageNameDict setObject:bgColor forKey:imageName];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue