mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 09:46:04 -05:00
28 lines
491 B
C++
28 lines
491 B
C++
|
/*
|
||
|
* Copyright (c) 2023, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
||
|
*
|
||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||
|
*/
|
||
|
|
||
|
#include <AK/Math.h>
|
||
|
#include <LibWeb/PixelUnits.h>
|
||
|
|
||
|
namespace Web {
|
||
|
|
||
|
float CSSPixels::to_float() const
|
||
|
{
|
||
|
return static_cast<float>(m_value) / fixed_point_denominator;
|
||
|
}
|
||
|
|
||
|
double CSSPixels::to_double() const
|
||
|
{
|
||
|
return static_cast<double>(m_value) / fixed_point_denominator;
|
||
|
}
|
||
|
|
||
|
int CSSPixels::to_int() const
|
||
|
{
|
||
|
return m_value / fixed_point_denominator;
|
||
|
}
|
||
|
|
||
|
}
|