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

hit detection #6

Open
davidm-public opened this issue Oct 22, 2017 · 2 comments
Open

hit detection #6

davidm-public opened this issue Oct 22, 2017 · 2 comments

Comments

@davidm-public
Copy link

hi, nice library, wondering if it's possible to do hit detection on a shape,
ie: to know which shape the mouse is over?

thanks

@fdb
Copy link
Member

fdb commented Oct 22, 2017

Yes, a Path object has a .contains method that takes an x/y argument. This also works on a Group.

@fdb
Copy link
Member

fdb commented Oct 22, 2017

Here's the source:

Path.prototype.contains = function (x, y, precision) {

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