mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-23 13:22:02 +03:00
39 lines
1.2 KiB
Mathematica
39 lines
1.2 KiB
Mathematica
|
//
|
||
|
// QBVideoIconView.m
|
||
|
// QBImagePicker
|
||
|
//
|
||
|
// Created by Katsuma Tanaka on 2015/04/04.
|
||
|
// Copyright (c) 2015 Katsuma Tanaka. All rights reserved.
|
||
|
//
|
||
|
|
||
|
#import "QBVideoIconView.h"
|
||
|
|
||
|
@implementation QBVideoIconView
|
||
|
|
||
|
- (void)awakeFromNib
|
||
|
{
|
||
|
[super awakeFromNib];
|
||
|
|
||
|
// Set default values
|
||
|
self.iconColor = [UIColor whiteColor];
|
||
|
}
|
||
|
|
||
|
- (void)drawRect:(CGRect)rect
|
||
|
{
|
||
|
[self.iconColor setFill];
|
||
|
|
||
|
// Draw triangle
|
||
|
UIBezierPath *trianglePath = [UIBezierPath bezierPath];
|
||
|
[trianglePath moveToPoint:CGPointMake(CGRectGetMaxX(self.bounds), CGRectGetMinY(self.bounds))];
|
||
|
[trianglePath addLineToPoint:CGPointMake(CGRectGetMaxX(self.bounds), CGRectGetMaxY(self.bounds))];
|
||
|
[trianglePath addLineToPoint:CGPointMake(CGRectGetMaxX(self.bounds) - CGRectGetMidY(self.bounds), CGRectGetMidY(self.bounds))];
|
||
|
[trianglePath closePath];
|
||
|
[trianglePath fill];
|
||
|
|
||
|
// Draw rounded square
|
||
|
UIBezierPath *squarePath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(CGRectGetMinX(self.bounds), CGRectGetMinY(self.bounds), CGRectGetWidth(self.bounds) - CGRectGetMidY(self.bounds) - 1.0, CGRectGetHeight(self.bounds)) cornerRadius:2.0];
|
||
|
[squarePath fill];
|
||
|
}
|
||
|
|
||
|
@end
|