mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
+ Some basic image editing functionality.
This commit is contained in:
49
Classes/BITRectangleImageAnnotation.m
Normal file
49
Classes/BITRectangleImageAnnotation.m
Normal file
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// BITRectangleImageAnnotation.m
|
||||
// HockeySDK
|
||||
//
|
||||
// Created by Moritz Haarmann on 25.02.14.
|
||||
//
|
||||
//
|
||||
|
||||
#import "BITRectangleImageAnnotation.h"
|
||||
|
||||
@interface BITRectangleImageAnnotation()
|
||||
|
||||
@property (nonatomic, strong) CAShapeLayer *shapeLayer;
|
||||
|
||||
@end
|
||||
|
||||
@implementation BITRectangleImageAnnotation
|
||||
|
||||
- (id)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
self.shapeLayer = [CAShapeLayer layer];
|
||||
self.shapeLayer.strokeColor = [UIColor redColor].CGColor;
|
||||
self.shapeLayer.lineWidth = 5;
|
||||
self.shapeLayer.fillColor = [UIColor clearColor].CGColor;
|
||||
[self.layer addSublayer:self.shapeLayer];
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
|
||||
self.shapeLayer.frame = self.bounds;
|
||||
self.shapeLayer.path = [UIBezierPath bezierPathWithRoundedRect:self.bounds cornerRadius:10].CGPath;
|
||||
}
|
||||
|
||||
/*
|
||||
// Only override drawRect: if you perform custom drawing.
|
||||
// An empty implementation adversely affects performance during animation.
|
||||
- (void)drawRect:(CGRect)rect
|
||||
{
|
||||
// Drawing code
|
||||
}
|
||||
*/
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user