Ticket #1708 (closed enhancement: invalid)
ratio-option for resizables
| Reported by: | c_t | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.2.2 |
| Component: | ui | Version: | 1.2.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Hi Guys!
It would be great to have a ratio-option for resizables like interface had. One common usecase for resizables is for example an image-cropper. In that case defining a ratio of width and height can be necessary. I would love to see such an option in the next release! I just don't have any idea which changes are necessary in ui.resizable.js ...
Thanks, Christoph
Change History
comment:2 Changed 6 years ago by c_t
OK, I figured out what was going wrong with the calculations when the shift-key was pressed. However, since this issue has not much to do with what I described in this ticket, I created a new bug-ticket: http://dev.jquery.com/ticket/1711
I will add a constraint option now and create a new ticket for that. You can mark this ticket as invalid or wontfix.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Oh well, the solution seems a lot easier than I thought! I just realized that the feature I requested basically is already integrated! It's exactly the behaviour that the resizables has while the shift-key is pressed. So what do you think about introducing a boolean option such as constraint and then just doing
instead of
I think this would be very useful and very easy to integrate though. By the way: The behaviour of the shift-key should be mentioned in the docs!
And the behaviour of the N, S, NE and NW handles is still buggy when the shift-key is pressed. I will try to figure out what the problem is...