Skip to content

Allow aspectRatio to be passed as a float#87

Open
CheeseSucker wants to merge 1 commit intoodyniec:masterfrom
CheeseSucker:patch-1
Open

Allow aspectRatio to be passed as a float#87
CheeseSucker wants to merge 1 commit intoodyniec:masterfrom
CheeseSucker:patch-1

Conversation

@CheeseSucker
Copy link

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
}

Currently aspect ratio must be supplied as two numbers separated by a colon. E.g. 
options = {
    aspectRatio: "4:3"
}

However, many times it is 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
}
@willherzog
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants