mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:37:35 +00:00
LibGfx: Add a 'Point::absolute_relative_distance_to(Point)'
This is significantly more elegant than subtracting the points and constructing another point from the abs() of their individual components.
This commit is contained in:
parent
169beff21e
commit
b2d698472b
1 changed files with 5 additions and 0 deletions
|
@ -208,6 +208,11 @@ public:
|
|||
return sqrtf(powf(m_x - other.m_x, 2.0f) + powf(m_y - other.m_y, 2.0f));
|
||||
}
|
||||
|
||||
Point absolute_relative_distance_to(const Point& other) const
|
||||
{
|
||||
return { abs(dx_relative_to(other)), abs(dy_relative_to(other)) };
|
||||
}
|
||||
|
||||
template<typename U>
|
||||
Point<U> to_type() const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue