Skip to content

Coordinate mapping inconsistent between tapViewAtPoint and other tap/touch commands #43

@CMTaylor

Description

@CMTaylor

tapViewAtPoint maps the coordinates of the given point like this:

  • (CGPoint) tapView:(UIView *)view atPoint:(CGPoint)point{
    CGPoint tapPoint = [self tapCoordsForView:view atPoint:point];

Whereas other tap/touch methods like longTapViewAtPoint do the coordinate mapping like this:

  • (CGPoint) longTapView:(UIView *)view atPoint:(CGPoint)point forDuration:(NSTimeInterval)duration{
    CGPoint tapPoint = [view convertPoint:point toView:nil];

I don't understand why these mappings are different, nor how anyone else can use them when they don't work correctly for me. When I replace the coordinate mapping in longTapViewATPoint above with a clone of the mapping from tapViewAtPoint:
CGPoint tapPoint = [self tapCoordsForView:view atPoint:point];
then longTapViewAtPoint works correctly.

doubleTapViewAtPoint has the same problem, with the same fix. I've tested both these fixes and am prepared to generate a PR on TestingWithFrank/PublicAutomation to share my fixes. However I suspect that more needs fixing, since there are several other occurrences of the incorrect:
CGPoint tapPoint = [view convertPoint:point toView:nil];
mapping in the code, but in methods that my test cases do not exercise. I haven't touched these yet, until I can be sure that I'm correct in making such a global change to the coordinate mapping.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions