Bug Tracker

Modify

Ticket #2291 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

resizable: redundant options? (o.aspectRatio / o.ratio)

Reported by: c_t Owned by: braeker
Priority: major Milestone: 1.2.3
Component: ui Version: 1.2.2
Keywords: Cc:
Blocking: Blocked by:

Description

As far as I understand the code if I want a resizable to preserve its aspect ratio I have to specify o.aspectRatio = true .

If I want to force a specific aspectRatio I have to additionaly specify the option e.g. o.ratio = 0.5 .

I think one option would be enough and suggest the following behaviour:

  • o.aspectRatio = false -> Aspect ratio is not preserved
  • o.aspectRatio = true -> On the first resize the aspect ratio is calculated from the element's dimensions and stored internally. I would not recommend recalculating the aspect ratio on every resize since this will lead to rounding errors after some resizes.
  • o.aspectRatio = float -> If a floating point number is given that aspect ratio is forced upon the first resize.

To summarize I think there should not be an additional o.ratio-option but the o.aspectRatio option should be used to control everything concerning the aspectRatio-preservation.

Change History

comment:1 Changed 5 years ago by paul

  • Owner changed from paul to braeker

comment:2 Changed 5 years ago by braeker

  • Status changed from new to closed
  • Resolution set to fixed

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.