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,43 @@
#import <LegacyComponents/TGDocumentAttributeImageSize.h>
#import <LegacyComponents/PSKeyValueCoder.h>
@implementation TGDocumentAttributeImageSize
- (instancetype)initWithSize:(CGSize)size
{
self = [super init];
if (self != nil)
{
_size = size;
}
return self;
}
- (instancetype)initWithKeyValueCoder:(PSKeyValueCoder *)coder
{
return [self initWithSize:CGSizeMake([coder decodeInt32ForCKey:"w"], [coder decodeInt32ForCKey:"h"])];
}
- (void)encodeWithKeyValueCoder:(PSKeyValueCoder *)coder
{
[coder encodeInt32:(int32_t)_size.width forCKey:"w"];
[coder encodeInt32:(int32_t)_size.height forCKey:"h"];
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
return [self initWithSize:[aDecoder decodeCGSizeForKey:@"size"]];
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeCGSize:_size forKey:@"size"];
}
- (BOOL)isEqual:(id)object
{
return [object isKindOfClass:[TGDocumentAttributeImageSize class]] && CGSizeEqualToSize(_size, ((TGDocumentAttributeImageSize *)object)->_size);
}
@end