mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:17:35 +00:00
LibWeb: Use CSSPixelFraction
to represent aspect ratios
This allows us to retain perfect precision for aspect ratios derived from either the intrinsic sizes of replaced elements, or the `aspect-ratio` CSS property.
This commit is contained in:
parent
4fb209d25f
commit
34c5043cbe
22 changed files with 57 additions and 55 deletions
|
@ -14,6 +14,8 @@ namespace Web::CSS {
|
|||
class Ratio {
|
||||
public:
|
||||
Ratio(double first, double second = 1);
|
||||
double numerator() const { return m_first_value; }
|
||||
double denominator() const { return m_second_value; }
|
||||
double value() const { return m_first_value / m_second_value; }
|
||||
bool is_degenerate() const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue