mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:27:43 +00:00
SharedGraphics: Add LogStream operator<<'s for Rect, Point and Size.
This commit is contained in:
parent
05cc59921a
commit
07d11a9b6b
3 changed files with 18 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AK/AKString.h>
|
#include <AK/AKString.h>
|
||||||
|
#include <AK/LogStream.h>
|
||||||
|
|
||||||
class Rect;
|
class Rect;
|
||||||
struct WSAPI_Point;
|
struct WSAPI_Point;
|
||||||
|
@ -71,3 +72,8 @@ private:
|
||||||
int m_x { 0 };
|
int m_x { 0 };
|
||||||
int m_y { 0 };
|
int m_y { 0 };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline const LogStream& operator<<(const LogStream& stream, const Point& value)
|
||||||
|
{
|
||||||
|
return stream << value.to_string();
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AK/AKString.h>
|
#include <AK/AKString.h>
|
||||||
|
#include <AK/LogStream.h>
|
||||||
#include <SharedGraphics/Point.h>
|
#include <SharedGraphics/Point.h>
|
||||||
#include <SharedGraphics/Size.h>
|
#include <SharedGraphics/Size.h>
|
||||||
#include <SharedGraphics/TextAlignment.h>
|
#include <SharedGraphics/TextAlignment.h>
|
||||||
|
@ -244,3 +245,8 @@ inline void Point::constrain(const Rect& rect)
|
||||||
else if (y() > rect.bottom())
|
else if (y() > rect.bottom())
|
||||||
set_y(rect.bottom());
|
set_y(rect.bottom());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline const LogStream& operator<<(const LogStream& stream, const Rect& value)
|
||||||
|
{
|
||||||
|
return stream << value.to_string();
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AK/AKString.h>
|
#include <AK/AKString.h>
|
||||||
|
#include <AK/LogStream.h>
|
||||||
|
|
||||||
struct WSAPI_Size;
|
struct WSAPI_Size;
|
||||||
|
|
||||||
|
@ -57,3 +58,8 @@ private:
|
||||||
int m_width { 0 };
|
int m_width { 0 };
|
||||||
int m_height { 0 };
|
int m_height { 0 };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline const LogStream& operator<<(const LogStream& stream, const Size& value)
|
||||||
|
{
|
||||||
|
return stream << value.to_string();
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue