Giter Club home page Giter Club logo

Comments (6)

gabriellanata avatar gabriellanata commented on June 13, 2024 1

Also to clarify. Technically all these validation methods are unnecessary for the library to work. The library just generates a tap at a coordinate and gets no response from the system. So these just exist to give useful errors when we detect the tap probably failed

from hammer.

gabriellanata avatar gabriellanata commented on June 13, 2024 1

Hi @nsoojin. I investigated if tapping a view that is not contained inside the bounds does not work (unless you modify the container view's point(inside: ...) method). I've attached a simple sample project where a blue box contains a green button partially outside the bounds. You can see that tapping on the parts outside the bounds do not trigger an action.

TestTapOutOfBounds.zip

In any case I do agree that there is a bug in the visibility methods because they don't take into account the clipping. Here is a PR that fixes that: #41

Please let me know if there's something else I'm missing or if this solves your problem.

from hammer.

nsoojin avatar nsoojin commented on June 13, 2024

@gabriellanata
I think there needs to be another way to determine "visibility". Do you have any other ideas?
Or, do we must have that check? What happens if it's removed?

from hammer.

gabriellanata avatar gabriellanata commented on June 13, 2024

Hmm my understanding is that a view will not receive touches outside of it's bounds unless you modify the view's own hit testing methods. So technically the name "isVisible" might be wrong but the behavior should be correct in assuming it's not hittable.

I'll verify tomorrow. If it is hittable we might be able to check if the views between it are clipped to determine if it's just out of bounds but still visible. And if it's not hittable outside of the bounds maybe i'll rename the method for clarity

from hammer.

nsoojin avatar nsoojin commented on June 13, 2024

Hmm my understanding is that a view will not receive touches outside of it's bounds

I'm trying to receive touch within it's own bounds. The bug happens when the view is outside superview's bounds.

This view is interactable in the app, and if I use CGPoint, Hammer successfully interacts with it, but not with the viewWithIdentifier. So the view is actually hittable but getting filtered by the check.

CGPoint(x: 412, y: 736) is the location of "video.frame.pointer.left"

// works
try eventGenerator.fingerDown(at: CGPoint(x: 412, y: 736))
try eventGenerator.fingerMove(to: CGPoint(x: 200, y: 736), duration: 1)
// error on fingerDown
try eventGenerator.fingerDown(at: try eventGenerator.viewWithIdentifier("video.frame.pointer.left"))
try eventGenerator.fingerMove(to: CGPoint(x: 200, y: 736), duration: 1)

Screen Shot 2022-02-21 at 1 08 10 PM

from hammer.

nsoojin avatar nsoojin commented on June 13, 2024

Right. sorry for the confusion, I missed I was overriding point(inside:) 😆

Your PR #41 fixes the issue. Thank you

from hammer.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.