mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:57:45 +00:00
LibGUI: Add Variant::as_float_or(fallback)
This commit is contained in:
parent
49b9683381
commit
2d1eff01a2
1 changed files with 7 additions and 0 deletions
|
@ -175,6 +175,13 @@ public:
|
||||||
return m_value.as_float;
|
return m_value.as_float;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float as_float_or(float fallback) const
|
||||||
|
{
|
||||||
|
if (is_float())
|
||||||
|
return as_float();
|
||||||
|
return fallback;
|
||||||
|
}
|
||||||
|
|
||||||
Gfx::IntPoint as_point() const
|
Gfx::IntPoint as_point() const
|
||||||
{
|
{
|
||||||
return { m_value.as_point.x, m_value.as_point.y };
|
return { m_value.as_point.x, m_value.as_point.y };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue