Add setWidthFromRatio and setHeightFromRatio to Settings
See original GitHub issueExample usage: (when width or height is known and the other aspect needs to be set using a specific ratio)
settings.setWidth(800);
settings.setHeightFromRatio(16 / 9);
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Set height as a ratio of width with only css - html
CSS has a built-in property called aspect-ratio just assign it to the element after height or width has been defined. CSS-tricks has an...
Read more >How To - Aspect Ratio / Height Equal to Width
The aspect ratio of an element describes the proportional relationship between its width and its height. Two common video aspect ratios are 4:3...
Read more >aspect-ratio - CSS: Cascading Style Sheets - MDN Web Docs
The aspect-ratio CSS property sets a preferred aspect ratio for the box ... The box's preferred aspect ratio is the specified ratio of...
Read more >aspect-ratio
The CSS property aspect-ratio lets you create boxes that maintain proportional dimensions where the height and width of a box are calculated ...
Read more >New aspect-ratio CSS property supported in Chromium, Safari ...
Maintaining aspect ratio within images and elements is now easier to ... setting aspect-ratio to a specified ratio of width / height ....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@nandhae You can work too. I was not able to add as I don’t know much kotlin.
@AlmasB Raised a PR #675 with two simple functions which takes ratio as a fraction. The clarifications i would be needing are,
Any suggestions or directions on these points would help. Would be happy to refactor and enhance.