Skip to content
This repository was archived by the owner on Nov 11, 2024. It is now read-only.

Commit 0c56034

Browse files
committed
fix: respect layer.transform in hitTest
For some reason, the NSView "convertPoint:fromView:" method does not respect layer transforms.
1 parent df1072f commit 0c56034

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

React/Views/RCTView.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,10 @@ - (NSView *)hitTest:(CGPoint)point
225225
// of the hit view will return YES from -pointInside:withEvent:). See:
226226
// - https://developer.apple.com/library/ios/qa/qa2013/qa1812.html
227227
for (NSView *subview in [sortedSubviews reverseObjectEnumerator]) {
228-
CGPoint convertedPoint = [subview convertPoint:point fromView:self];
228+
CGPoint convertedPoint = subview.layer
229+
? [subview.layer convertPoint:point fromLayer:subview.layer.superlayer]
230+
: [subview convertPoint:point fromView:self];
231+
229232
hitSubview = [subview hitTest:convertedPoint];
230233
if (hitSubview != nil) {
231234
break;

0 commit comments

Comments
 (0)