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

Group Transform Bug #2964

Closed
HunterMitchell opened this issue May 12, 2016 · 15 comments
Closed

Group Transform Bug #2964

HunterMitchell opened this issue May 12, 2016 · 15 comments
Labels

Comments

@HunterMitchell
Copy link

HunterMitchell commented May 12, 2016

Version

1.6.1

Test Case

https://jsfiddle.net/6269qpdu/

Steps to reproduce

Select (group) the two rectangle and randomly transform them (i.e. squashing the entire object as small as possible). Note: I had to do the process multiple times, sometimes fast for the bug to occur. When this happens i get something that looks like this:

image

I think this has something to do with me changing the padding here: fabric.Object.prototype.padding = 5;. When I remove this, everything seems to work fine. This bring me to a better point. Is there a decent way other than this to override these values?

Expected Behavior

The group should normally transform.

Actual Behavior

When grabbing the top/left/right controls and squashing the group, the entire group disappears and jumps to the top left of the canvas.
dit fiddle - jsfiddle20160512045126

@asturur
Copy link
Member

asturur commented May 12, 2016

They way you override the padding is ok.
Can you make the bug to happen in reproducible way?

@asturur
Copy link
Member

asturur commented May 12, 2016

I found it.
Group them, skew from right handle going up,
Then from left handle flip over.

@HunterMitchell
Copy link
Author

@asturur Great! I posted a horrible GIF showing at least what is happening (edited)

@HunterMitchell
Copy link
Author

Also, I would like to note on my project, the bug is worse. All i have to do is attempt to flip anywhere and it occurs. I am not sure why the JSFIDDLE take a few tries to get it to bug out.

@asturur
Copy link
Member

asturur commented May 12, 2016

Something hard to find out. I was about to release 1.6.2 but i have to fix this first.

@HunterMitchell
Copy link
Author

For some reason it goes away "I think" when you set the padding to 0. Also, I'm not sure if this is related, but now my backgroundImage for my canvas doesn't scale anymore with my canvas.

@asturur
Copy link
Member

asturur commented May 12, 2016

image

This is killing it.
When you scale down to flip, you arrive at the point that you have twice the padding ( from object and group ), Object has scale nearly 0, but we are still trying to reduce it and something bad happen. A division by 0 probably

@asturur
Copy link
Member

asturur commented May 12, 2016

No ok, bug is generic. Remove padding, group object, do not transform, scale to flip, go slow, when you cross the border of 0 it happens. :( This evening Cinema, tomorrow morning i'll look at it.

@asturur asturur added the bug label May 12, 2016
@HunterMitchell
Copy link
Author

@asturur did you find what was causing this issue?

@asturur
Copy link
Member

asturur commented May 13, 2016

no movie finished to late to wake up early before work and do it. i hope this weekend i can clear out and release.

@HunterMitchell
Copy link
Author

That is fine, I also think I found a bug regarding cloning groups, however I posted a question on StackOverflow regarding it if you would like to glance at it.

@asturur
Copy link
Member

asturur commented May 13, 2016

i saw the question, i tried to understand what is going on. I put it in the list of things to verify.

@HunterMitchell
Copy link
Author

I attached a jsfiddle to show what is going on. I also did not mean to close the issue :)

@asturur
Copy link
Member

asturur commented May 14, 2016

This is a very strange bug and i do not understand why it did not came out before.
The bug is active since we introduced skew, and this because we started dividing some factor by actual dimensions. When going to flip actual dimensions go near 0, and dividing by 0 create the NaN value and ruin the rendering.

The fact is that we have a parameter that saves us and this is minScaleLimit. Now for objects bigger than 250 pixels ( very common ) this parameter is rounded to 0.
Math.round(1/250, 2) = 0

@HunterMitchell
Copy link
Author

Awesome! When should we expect this (with the next update) to come out?

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

No branches or pull requests

2 participants