Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fabric] Fixes findNodeAtPoint when views were inverted #45519

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update
  • Loading branch information
zhongwuzw committed Aug 15, 2024
commit ed166f9cca81fed6cca650ed63d215e6fe9594fb
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@ ShadowNode::Shared LayoutableShadowNode::findNodeAtPoint(
auto transformedFrame = frame * transform;
auto isPointInside = transformedFrame.containsPoint(point);

if (!isPointInside) {
return nullptr;
} else if (!layoutableShadowNode->canChildrenBeTouchTarget()) {
return node;
}

if (Transform::isVerticalInversion(transform) ||
Transform::isHorizontalInversion(transform)) {
auto centerX =
Expand All @@ -286,11 +292,6 @@ ShadowNode::Shared LayoutableShadowNode::findNodeAtPoint(
point.x = centerX + relativeX;
point.y = centerY + relativeY;
}
if (!isPointInside) {
return nullptr;
} else if (!layoutableShadowNode->canChildrenBeTouchTarget()) {
return node;
}

auto newPoint = point - transformedFrame.origin -
layoutableShadowNode->getContentOriginOffset(false);
Expand Down
Loading