Skip to content

Commit

Permalink
_ASCollectionViewCell - The point isn't converted before to send to n…
Browse files Browse the repository at this point in the history
…ode, impossible to touch button into the node hierarchy (facebookarchive#1362)

* Revert node call, useless, the node has a ASDisplayView, and this view forward on the node in first.

* Use convertPoint to convert the given point in hittest & pointInside methods.
Keep the standard usage if the node didn't rasterized a view.

* Removed isNodeLoaded, finally it's useless in this case
In these methods, we are on the mainThread, we can create the view if the view is not created.
  • Loading branch information
Idefix60 authored and Adlai-Holler committed Mar 5, 2019
1 parent 17dbd8e commit 2a93792
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Source/Details/_ASCollectionViewCell.mm
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,14 @@ - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
return nil;
}

return [self.node hitTest:point withEvent:event];
CGPoint pointOnNode = [self.node.view convertPoint:point fromView:self];
return [self.node hitTest:pointOnNode withEvent:event];
}

- (BOOL)pointInside:(CGPoint)point withEvent:(nullable UIEvent *)event
{
return [self.node pointInside:point withEvent:event];
CGPoint pointOnNode = [self.node.view convertPoint:point fromView:self];
return [self.node pointInside:pointOnNode withEvent:event];
}

@end
Expand Down

0 comments on commit 2a93792

Please sign in to comment.