@@ -36,7 +36,8 @@ - (id)initWithCoder:(NSCoder *)aDecoder {
3636}
3737
3838- (void )commonInit {
39- self.insetSizeRatio = 0.35 ;
39+ self.sizeRatio = 0.3 ;
40+ self.highlightedSizeRatio = 0.9 ;
4041
4142 CAShapeLayer *shapeLayer = [CAShapeLayer new ];
4243 [self .layer addSublayer: shapeLayer];
@@ -51,19 +52,19 @@ - (void)commonInit {
5152- (CGRect)frameThatFits : (CGRect)parentBounds {
5253 CGFloat sizeValue = MIN (parentBounds.size .width , parentBounds.size .height );
5354 CGSize viewSize = CGSizeMake (sizeValue, sizeValue);
54- const CGFloat sizeRatio = self.insetSizeRatio ;
55+ const CGFloat insetSizeRatio = ( 1 - self.sizeRatio ) / 2.0 ;
5556 return CGRectInset (MRCenterCGSizeInCGRect (viewSize, parentBounds),
56- sizeValue * sizeRatio ,
57- sizeValue * sizeRatio );
57+ sizeValue * insetSizeRatio ,
58+ sizeValue * insetSizeRatio );
5859}
5960
6061- (void )layoutSubviews {
6162 [super layoutSubviews ];
6263
6364 CGRect frame = self.bounds ;
6465
65- if (self.tracking && self.touchInside ) {
66- const CGFloat insetSizeRatio = 0.033 ;
66+ if (self.tracking && self .touchInside ) {
67+ const CGFloat insetSizeRatio = ( 1 - self. highlightedSizeRatio ) / 2.0 ;
6768 frame = CGRectInset (frame,
6869 frame.size .width * insetSizeRatio,
6970 frame.size .height * insetSizeRatio);
0 commit comments