Merge commit '7621e2f8dec938cf48181c8b10afc9b01f444e68' into beta

This commit is contained in:
Ilya Laktyushin
2025-12-06 02:17:48 +04:00
commit 8344b97e03
28070 changed files with 7995182 additions and 0 deletions
@@ -0,0 +1,42 @@
#import "TGNeoImageViewModel.h"
@implementation TGNeoImageViewModel
- (instancetype)initWithImage:(UIImage *)image
{
self = [super init];
if (self != nil)
{
_image = image;
}
return self;
}
- (instancetype)initWithImage:(UIImage *)image tintColor:(UIColor *)tintColor
{
self = [super init];
if (self != nil)
{
_image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
_tintColor = tintColor;
}
return self;
}
- (void)drawInContext:(CGContextRef)context
{
UIGraphicsPushContext(context);
if (_tintColor != nil)
{
CGContextSaveGState(context);
CGContextSetFillColorWithColor(context, _tintColor.CGColor);
}
[self.image drawInRect:CGRectMake((self.frame.size.width - self.image.size.width) / 2, (self.frame.size.height - self.image.size.height) / 2, self.image.size.width, self.image.size.height)];
if (_tintColor)
CGContextRestoreGState(context);
UIGraphicsPopContext();
}
@end