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

Cannot drag small objects #5369

Closed
nickasd opened this issue Nov 5, 2018 · 8 comments · Fixed by #5379
Closed

Cannot drag small objects #5369

nickasd opened this issue Nov 5, 2018 · 8 comments · Fixed by #5379
Labels

Comments

@nickasd
Copy link

nickasd commented Nov 5, 2018

Version

2.4.0

Test Case

http://fabricjs.com/many-objects

Information about environment

Safari 12.0

Steps to reproduce

Select one of the dots in the right canvas and drag it around.

Expected Behavior

The selected dot should be dragged.

Actual Behavior

The selected dot is resized. The problem is that apparently for very small objects resizing has a higher priority over dragging.

@asturur
Copy link
Member

asturur commented Nov 8, 2018

so controls have priority over dragging, and that may make sense because otherwise the inner part of the control, the one inside the bounding box, would never work.

I wonder if we can consider this a bug or a fact, and how we could ever solve the problem.

What would you consider a correct default behaviour, that is not reinventing the wheel, but that you can see also in other applications?

@nickasd
Copy link
Author

nickasd commented Nov 8, 2018

I don't understand what you mean with your first sentence, but my expected behavior would probably be that you can only resize an object once it's been selected (which I think is a standard for many image editing apps) and you can move it without first having to select it, i.e. you can click down and immediately start the drag. Once it is selected, I would expect it to always have a minimum area at the center which I can use to drag it around, possibly slightly offsetting the resize controls, but I see that for example Pixelmator Pro gives higher priority to the resize controls in this case.

@asturur
Copy link
Member

asturur commented Nov 8, 2018

if controls does not react before dragging, when clicking the part of controls that is inside the object area you would drag rather than use the control. that was my first sentence.

@nickasd
Copy link
Author

nickasd commented Nov 8, 2018

Hmm ... I tried dragging many of the dots in the example by clicking inside the object area but all got resized instead of being dragged.

@asturur
Copy link
Member

asturur commented Nov 8, 2018

yes ok there is a bug.
I m sure the wanted behaviour was that from unselected you can only drag to avoid accindental resizing.
When selected resizing is easier than dragging.
When selected for small small object dragging is impossible but that is a problem we are going to keep and that devs should solve with padding maybe.

whitout interaction tests this area is always fragile. I m not sure what framework that run in browsers and node (potentially, not necessary ) can solve this

@asturur
Copy link
Member

asturur commented Nov 8, 2018

this bug is on 2.4.0 or 2.4.3?

@asturur asturur added the bug label Nov 8, 2018
@nickasd
Copy link
Author

nickasd commented Nov 8, 2018

It's 2.4.3. Thanks!

@asturur
Copy link
Member

asturur commented Nov 9, 2018

ok so i opened a PR tests are broken at least, showing that some test was there.
I need to find time to write tests, and i ll merge it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants