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

general selection logic - difficulties #3004

Closed
DanieleSassoli opened this issue May 23, 2016 · 10 comments
Closed

general selection logic - difficulties #3004

DanieleSassoli opened this issue May 23, 2016 · 10 comments

Comments

@DanieleSassoli
Copy link
Contributor

Hi,
If I add 2 SVG shapes to the kitchensink sample and overlay them I'm unable to use the controls of the bottom one because the top one gets automatically selected, this didn't happen before the last update.
Any clue of what this could be?

@asturur
Copy link
Member

asturur commented May 23, 2016

I was playing with this problem yesterday.
Can you be more specifici with a screenshot that show how they are overlaid?

It should happen with anyshape. Our selection logic select the topmost object when you click, regardless of what you selected before ( execption made for active group that is checked before ).

I was checking the code and there is some duplicate logic here and there. You can see in the PR #2997 i changed something. But i think that active object should be checked on top of the other things. before or after activeGroup.

Are you sure that this was not happening before? I remember seeing this since long.

@alanmastro
Copy link

In fact the problem is more generic and occurs with any type of element. The problem occurs with individual elements and element groups whenever there is an overlap

@DanieleSassoli
Copy link
Contributor Author

Actually, if you say it was happening before then maybe I hadn't encountered it before, so no I'm not sure anymore.
I'll attach a screenshot of one simple case, as you can see there are also 2 lines from the central-top controls that lead to nowhere.
@alanmastro is right, it happens with any tipe of element!
immagine

@asturur
Copy link
Member

asturur commented May 23, 2016

The lines are probably running to 0,0 and could be a problem of your hardware. i cannot make them happen.
Those lines could be some strange issue with drawing the rotation handle, that is a line.
What browser are you using?

For the selection logic as of now it is like that:

on click:

is there any activegroup and the active group contains point clicked?
if yes target is activegroup and another selection process start.

No, there is no active group or we clicked outside it, so run trought all elements and return the topmost that contains point ( or makes happy other conditions with trasparencies, controls... ).

There is no check for the activeObject that has been selected. And i think there should be.
And i was actually writing that. The problem is that testing all the user interaction is a pain and i'm very scared to change something and do big regressions.

@asturur
Copy link
Member

asturur commented May 23, 2016

tipically when you have on canvas 70 elements you have difficulties selecting whatever is on the back, you have to move away top objects so that they not interfere with click.
Svgs are tricky because normally they have bigger bounding boxes than single shapes.

@DanieleSassoli
Copy link
Contributor Author

I'm using Chrome 50.0.2661.102. I can imagine that testing all the user interaction can be big pain, I'd be very scare to make big regressions my self!
Yes probably there should be a check fot the activeObject, I've never looked inside this part of Fabric though...

@asturur asturur changed the title SVG Kitchnesink, can't select underlaying SVG shapes general selection logic - difficulties May 23, 2016
@alanmastro
Copy link

Any news?

@asturur
Copy link
Member

asturur commented Jun 19, 2016

@DanieleSassoli, any particular idea here? I added a key + click combination to retrieve the last rendered object during click if someone should find it usefull.

@alanmastro
Copy link

What is the combination of keys to use?

@asturur
Copy link
Member

asturur commented Jun 20, 2016

either control or alt. Please check file canvas.class.js in current master for default value of lastRenderedKey.

@asturur asturur closed this as completed Jul 3, 2016
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

3 participants