mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-17 07:50:04 +00:00
LibGfx: Add formatter for Rect.
This commit is contained in:
parent
cf6980848b
commit
3b601cd4bd
Notes:
sideshowbarker
2024-07-19 01:57:01 +09:00
Author: https://github.com/asynts
Commit: 3b601cd4bd
Pull-request: https://github.com/SerenityOS/serenity/pull/3731
1 changed files with 13 additions and 0 deletions
|
@ -26,6 +26,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Format.h>
|
||||
#include <LibGfx/Orientation.h>
|
||||
#include <LibGfx/Point.h>
|
||||
#include <LibGfx/Size.h>
|
||||
|
@ -411,6 +412,18 @@ ALWAYS_INLINE IntRect enclosing_int_rect(const FloatRect& float_rect)
|
|||
|
||||
}
|
||||
|
||||
namespace AK {
|
||||
|
||||
template<typename T>
|
||||
struct Formatter<Gfx::Rect<T>> : Formatter<StringView> {
|
||||
void format(TypeErasedFormatParams& params, FormatBuilder& builder, const Gfx::Rect<T>& value)
|
||||
{
|
||||
Formatter<StringView>::format(params, builder, value.to_string());
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace IPC {
|
||||
|
||||
bool decode(Decoder&, Gfx::IntRect&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue