We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
hitTestAll method for Project object does not return Group object but his children when color of one of the object differs.
hitTestAll
Project
Group
Example:
// paperscript settings.insertItems = false const rect1 = new Path.Rectangle([0], [100, 100]) rect1.fillColor = 'red' rect1.strokeColor = 'black' const rect2 = new Path.Rectangle([25, 25], [50, 50]) rect2.fillColor = 'red' rect2.strokeColor = 'black' const group = new Group(rect1, rect2) project.activeLayer.addChild(group) console.log(project.hitTestAll([30, 30]))
Here hitTestAll method will return array with 3 elements: 2 Rectangle paths and one Group.
Rectangle
Next example:
settings.insertItems = false const rect1 = new Path.Rectangle([0], [100, 100]) rect1.fillColor = 'red' rect1.strokeColor = 'black' const rect2= new Path.Rectangle([25, 25], [50, 50]) rect2.fillColor = 'white' rect2.strokeColor = 'black' const group = new Group(rect1, rect2) project.activeLayer.addChild(group) console.log(project.hitTestAll([30, 30]))
This code will return only group's children and will skip Group object.
Maybe this link to Sketch will be useful.
hitTestAll returns both Group and it's elements.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description/Steps to reproduce
hitTestAll
method forProject
object does not returnGroup
object but his children when color of one of the object differs.Example:
Here
hitTestAll
method will return array with 3 elements: 2Rectangle
paths and oneGroup
.Next example:
This code will return only group's children and will skip
Group
object.Maybe this link to Sketch will be useful.
Expected result
hitTestAll
returns bothGroup
and it's elements.The text was updated successfully, but these errors were encountered: