mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:27:35 +00:00
LibWeb: Use float for GridTrackSize length value
Use float instead of int for the GridTrackSize length value as FlexibleLengths can be "1fr" as well as ".49fr" in grid-track-row and grid-track-column values.
This commit is contained in:
parent
ca3d479f6f
commit
2fa124e8d9
2 changed files with 4 additions and 4 deletions
|
@ -24,7 +24,7 @@ GridTrackSize::GridTrackSize(Percentage percentage)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
GridTrackSize::GridTrackSize(int flexible_length)
|
GridTrackSize::GridTrackSize(float flexible_length)
|
||||||
: m_type(Type::FlexibleLength)
|
: m_type(Type::FlexibleLength)
|
||||||
, m_flexible_length(flexible_length)
|
, m_flexible_length(flexible_length)
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,7 +24,7 @@ public:
|
||||||
|
|
||||||
GridTrackSize(Length);
|
GridTrackSize(Length);
|
||||||
GridTrackSize(Percentage);
|
GridTrackSize(Percentage);
|
||||||
GridTrackSize(int);
|
GridTrackSize(float);
|
||||||
|
|
||||||
Type type() const { return m_type; }
|
Type type() const { return m_type; }
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ public:
|
||||||
|
|
||||||
Length length() const { return m_length; }
|
Length length() const { return m_length; }
|
||||||
Percentage percentage() const { return m_percentage; }
|
Percentage percentage() const { return m_percentage; }
|
||||||
int flexible_length() const { return m_flexible_length; }
|
float flexible_length() const { return m_flexible_length; }
|
||||||
|
|
||||||
String to_string() const;
|
String to_string() const;
|
||||||
bool operator==(GridTrackSize const& other) const
|
bool operator==(GridTrackSize const& other) const
|
||||||
|
@ -49,7 +49,7 @@ private:
|
||||||
Type m_type;
|
Type m_type;
|
||||||
Length m_length { Length::make_px(0) };
|
Length m_length { Length::make_px(0) };
|
||||||
Percentage m_percentage { Percentage(0) };
|
Percentage m_percentage { Percentage(0) };
|
||||||
int m_flexible_length { 0 };
|
float m_flexible_length { 0 };
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue