-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[WIP] Handle group transformation with skew and rotate + scale #2549
Conversation
_CONTROL BOXES WILL BE FIXED LATER_
-Create 4 rectangle ( free code given :) ) if you flip group and destroy group, everythings looks fine. it involves flipping and negative scaling, but i cannot figure out why. |
issues described here no loger exist. |
controlboxes fixed, active group now behaves very good. Also adding an object to an already transformed active group looks fine. |
@asturur what else is left? |
Code needs optimizations and caching. But this we can do later after we are sure everything is working properly. Transformations now more general and work in most situation. Any i could test. Also in drawBorders, drawControls you can check i added a "sign" var. Consider this var as a temp patch because i could not figure out what was happening with negative scaling. comment the code if necessary, i will then correct and squeeze commits |
If it is green you can merge @kangax. |
ready to merge |
var matrix = object.calcTransformMatrix(), | ||
options = fabric.util.qrDecompose(matrix), | ||
center = new fabric.Point(options.translateX, options.translateY); | ||
object.scaleX = options.scaleX; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move all these calls into 1 method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you mean object.set(options) , no it does not work. Scale is often negative and is triggering an automatic flip change that creates a random flip when regrouping the objects.
I think is part of optmization possible, but as of now it would just stop it from working.
Wait, i found some glitches! |
the second gif "looks" good, but corners coordinates are handled differently and then are not clickable anymore. |
This is cool. I have one question, will this work with image object? |
of course. it works with any object. try it on: http://www.deltalink.it/andreab/fabric/kitchensink.html images must be added by execute tab or using the load json tab. |
Any timeframe for this great fix? |
i hope weekend! |
Sounds great, this is a very needed fix, great job on it : ) |
@kangax ready to merge. |
[WIP] Handle group transformation with skew and rotate + scale
Thanks for the update. Do I need to initial something in code so that the skewing will work? Currently I'm on version 1.6.0-rc.1 but not able to get the skewing work. |
skew by pressing shift button and using middle controls on side. or by code using skewX and skewY properties |
Hi @asturur , pressing shift didn't work in my code though. I tried to use jsfiddle (I manually upload 1.6.0-rc.1 js file), the shift key work. but the coordinate seem off for me. I still not sure why it work in jsfiddle but not my code though. hmm. Here is the sample: |
This is a WIP.
it is fully working excluding when we involve flipping in transformations.
I upload a demo as soon as i have time.
The strange thing is that everything works fine, but when i REGROUP items after ungrouping some flipping appears.
closes #726
closes #2515
closes #2297
closes #833