imgareaselect icon indicating copy to clipboard operation
imgareaselect copied to clipboard

Allow aspectRatio to be passed as a float

Open CheeseSucker opened this issue 8 years ago • 1 comments

Currently, aspect ratio must be supplied as two numbers separated by a colon.

options = {
    aspectRatio: "4:3"
}

However, it is often useful to provide the aspect ratio as a single number. Especially if the aspect ratio is calculated by code.

This patch allows configurations such as:

options = {
    aspectRatio: 1.5
}

CheeseSucker avatar Mar 19 '16 12:03 CheeseSucker

I agree that this would be useful. Since I already calculate the aspect ratio in my code, I hacked my version of the plugin to only take a float, but supporting both possibilities (string or float) is probably best.

willherzog avatar Jul 13 '18 23:07 willherzog