Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for portrait size ratios #6501

Merged
merged 3 commits into from Dec 1, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Ratio.tsx
Expand Up @@ -38,7 +38,7 @@ const defaultProps = {

function toPercent(num: number): string {
if (num <= 0 || num > 100) return '100%';
if (num < 1) return `${num * 100}%`;
if (num < 5) return `${num * 100}%`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to remove the upper limit of 100 in the line above so users can specify 200 as the value

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah of course - Thanks!
I've committed your suggestion with a change to tests to allow the taller aspect ratio.

return `${num}%`;
}

Expand Down