mirror of
https://github.com/Tencent/Hippy.git
synced 2026-10-29 06:06:52 +08:00
fix(ios): correct hittest when view has animation
This commit is contained in:
@@ -222,7 +222,16 @@ HIPPY_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
|
||||
// `hitSubview` is the topmost subview which was hit. The hit point can
|
||||
// be outside the bounds of `view` (e.g., if -clipsToBounds is NO).
|
||||
UIView *hitSubview = nil;
|
||||
BOOL isPointInside = [self pointInside:point withEvent:event];
|
||||
BOOL isPointInside = NO;
|
||||
// use presentationLayer to adapt the view with animation
|
||||
CALayer *presentationLayer = self.layer.presentationLayer;
|
||||
if (presentationLayer) {
|
||||
CGPoint layerPoint = [presentationLayer convertPoint:point fromLayer:self.layer];
|
||||
if ([presentationLayer containsPoint:layerPoint]) {
|
||||
isPointInside = YES;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL needsHitSubview = !(_pointerEvents == HippyPointerEventsNone || _pointerEvents == HippyPointerEventsBoxOnly);
|
||||
if (needsHitSubview && (![self clipsToBounds] || isPointInside)) {
|
||||
// The default behaviour of UIKit is that if a view does not contain a point,
|
||||
|
||||
Reference in New Issue
Block a user