BernalCarlos Posted March 1, 2013 Share Posted March 1, 2013 Hello, i have already asked this question in the following thread: http://forums.greensock.com/topic/6964-constrain-scaling-to-avoid-mirror-efects/ The solution was to set the minScaleX and minScaleY to 0 and that worked, but now I need to constrain the width and height of a transformItem, not the scale. So, i used the minWidth and minHeight properties of the item. At the beginning its seemed to work, however if I keep scaling beyond the min values, the item will eventually jump to negative scale values. I think its a bug but i don't know, any help will be greatly appreciated. Here a .fla that shows the problem: https://www.dropbox.com/s/wx6vtjho4vn0t9k/TransManager_MinWidthBug.fla Thank you. Link to comment Share on other sites More sharing options...
GreenSock Posted March 2, 2013 Share Posted March 2, 2013 Actually, no that's not a bug at all because it is entirely possible to have an object that's a certain width even at negative scale values. For example, if you've got a 100px wide object and you set the minWidth to 50, that means that if its scaleX is -0.7, that would make it 70px wide, thus it's totally "legal". Believe it or not, it took quite some effort to make that "bug" work that way It is entirely intentional. But if you don't want to allow the scale to go negative, just add these lines: _transItem.minScaleX = 0; _transItem.minScaleY = 0; Does that clear things up? Link to comment Share on other sites More sharing options...
BernalCarlos Posted March 2, 2013 Author Share Posted March 2, 2013 ooo I see, sorry for sugesting that it could be bug. But, can is use minWidth and minScale at the same time?, I cant try it rigth now. Thank you Jack. Link to comment Share on other sites More sharing options...
GreenSock Posted March 2, 2013 Share Posted March 2, 2013 Yep, you can use them both together. Have fun Link to comment Share on other sites More sharing options...
BernalCarlos Posted March 4, 2013 Author Share Posted March 4, 2013 Great, it works. Sorry for the dumb question and thank you very much for your help. Link to comment Share on other sites More sharing options...
GreenSock Posted March 5, 2013 Share Posted March 5, 2013 No problem at all. Enjoy. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now