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

subTargetCheck doesn't work if group if "selectable" #3686

Closed
ncou opened this issue Feb 11, 2017 · 3 comments · Fixed by #3688
Closed

subTargetCheck doesn't work if group if "selectable" #3686

ncou opened this issue Feb 11, 2017 · 3 comments · Fixed by #3688

Comments

@ncou
Copy link
Collaborator

ncou commented Feb 11, 2017

Hi,

I want to detect the object clicked, even if the object is in a group.

I use the "subTargetCheck" propertie and it work like a charm if my group is "selectable=false", if set it to selectable=true. it always return me the first clicked object and seems to be locked on this value.

Here is the codepen, i show in the console the color of the clicked rect object.
But if you change the value "selectable=true" line 20, you got the rect value on the first click, after you need to deselect the shape and click on the other rect to get the value.

http://codepen.io/anon/pen/zNyYEE

Is this normal ? an i clear enough ?
Thank you for your help.

PS : I was thinking the findtarget() with the skipGroup paramter could do the samething but i always got the object "group" as finded target. Am i a bit lost on the use of this method, can you enlighten me ?
Thank you.

@asturur
Copy link
Member

asturur commented Feb 12, 2017

skipgroup is for internal use. is used only for activegroup selection to return the objects inside.

i should specify in the docs that is not meant for dev use, at least you cannot do something really useful from it.

@asturur
Copy link
Member

asturur commented Feb 12, 2017

subTargetCheck should work, no idea what is the problem

@asturur
Copy link
Member

asturur commented Feb 12, 2017

ok, fabric uses a shortcut to return earlier in case of activeObject click.
So you gain some bullshit improvement in speed and we loose a feature.
I guess i'm fixing this.

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

Successfully merging a pull request may close this issue.

2 participants