Skip to content

Commit

Permalink
fix: improve hitTest to exclude touches outside the bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
jakex7 committed Jan 15, 2025
1 parent e7c4238 commit fb93d40
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apple/Elements/RNSVGSvgView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event

- (RNSVGPlatformView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
if (point.x < 0 || point.y < 0 || point.x > self.bounds.size.width || point.y > self.bounds.size.height) {
return nil;
}
CGPoint transformed = point;
if (self.align) {
transformed = CGPointApplyAffineTransform(transformed, _invViewBoxTransform);
Expand Down

0 comments on commit fb93d40

Please sign in to comment.