1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//
//  HDLOPPButton.m
//  HDLOnProIpad
//
//  Created by 陈启扬 on 2022/8/16.
//
 
#import "HDLEZButton.h"
 
@implementation HDLEZButton
 
 
 
-(BOOL)pointInside:(CGPoint)point withEvent:(UIEvent*)event
{
    CGRect bounds = self.bounds;
    //扩大原热区直径至26,可以暴露个接口,用来设置需要扩大的半径。
    CGFloat widthDelta = MAX(self.tapWidth, 0);
    CGFloat heightDelta = MAX(self.tapHeight, 0);
    bounds = CGRectInset(bounds, -0.5 * widthDelta, -0.5 * heightDelta);
    return CGRectContainsPoint(bounds, point);
}
 
@end