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

Fix the draggability of small objects #5379

Merged
merged 3 commits into from
Nov 17, 2018
Merged

Conversation

asturur
Copy link
Member

@asturur asturur commented Nov 9, 2018

Add a force rule ( we had it before somehow ) that objects cannot be scaled if not selected.
Realistically no one guess the corner position and start to drag it to scale.
Is often a drag operation that ends up with a scale one.
If you want to use a corner, first select the object.

close #5369

_getActionFromCorner: function(target, corner, e) {
if (!corner) {
_getActionFromCorner: function(alreadySelected, corner, e) {
if (!corner || !alreadySelected) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

target was there, unused.
Liinntttt where are you?

@asturur
Copy link
Member Author

asturur commented Nov 9, 2018

Not proud of this code, looks like a patch. The selection and action flow is complicated enough that i do not get away with a clean and straight forward code.

@asturur
Copy link
Member Author

asturur commented Nov 9, 2018

needs an extensive test where on an object, a simulated click checks each of the 9 corners and the center of the object and inspect the resulting action type both for an unselected object and for a selected one.

@asturur asturur merged commit d60ba22 into master Nov 17, 2018
@asturur asturur mentioned this pull request Nov 25, 2018
@asturur asturur deleted the scale-from-selected-only branch December 10, 2018 23:55
thiagocunha pushed a commit to thiagocunha/fabric.js that referenced this pull request Nov 18, 2019
* change to action logic

* fixed test

* added some tests
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 this pull request may close these issues.

Cannot drag small objects
1 participant