mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +00:00
SharedGraphics: Add LogStream operator<<'s for Rect, Point and Size.
This commit is contained in:
parent
05cc59921a
commit
07d11a9b6b
Notes:
sideshowbarker
2024-07-19 13:23:41 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/07d11a9b6b1
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/LogStream.h>
|
||||
|
||||
class Rect;
|
||||
struct WSAPI_Point;
|
||||
|
@ -71,3 +72,8 @@ private:
|
|||
int m_x { 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
|
||||
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/LogStream.h>
|
||||
#include <SharedGraphics/Point.h>
|
||||
#include <SharedGraphics/Size.h>
|
||||
#include <SharedGraphics/TextAlignment.h>
|
||||
|
@ -244,3 +245,8 @@ inline void Point::constrain(const Rect& rect)
|
|||
else if (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
|
||||
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/LogStream.h>
|
||||
|
||||
struct WSAPI_Size;
|
||||
|
||||
|
@ -57,3 +58,8 @@ private:
|
|||
int m_width { 0 };
|
||||
int m_height { 0 };
|
||||
};
|
||||
|
||||
inline const LogStream& operator<<(const LogStream& stream, const Size& value)
|
||||
{
|
||||
return stream << value.to_string();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue