Bug Tracker

Opened 13 years ago

Closed 13 years ago

#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:
Blocked by: Blocking:

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 (3)

comment:1 Changed 13 years ago by c_t

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

if(e.shiftKey || o.constraint)

instead of

if(e.shiftKey)

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...

comment:2 Changed 13 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.

comment:3 Changed 13 years ago by paul

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.