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

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

Open
CMTaylor opened this issue Jan 29, 2015 · 1 comment

Comments

@CMTaylor
Copy link
Contributor

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.

@moredip
Copy link
Member

moredip commented Jan 31, 2015

This is now available in frank-cucumber 1.2.5, released off of 858d8e7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants