mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +00:00
LibGUI: Add Variant::as_float_or(fallback)
This commit is contained in:
parent
49b9683381
commit
2d1eff01a2
Notes:
sideshowbarker
2024-07-18 08:02:37 +09:00
Author: https://github.com/awesomekling
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