LibGUI: Use String::formatted() and String::number() more

This commit is contained in:
Andreas Kling 2021-01-03 15:26:47 +01:00
commit 7bb18215cb
Notes: sideshowbarker 2024-07-19 00:10:08 +09:00
15 changed files with 48 additions and 24 deletions

View file

@ -26,7 +26,7 @@
#pragma once
#include <AK/Forward.h>
#include <AK/Format.h>
#include <AK/StdLibExtras.h>
#include <LibGfx/Forward.h>
#include <LibGfx/Orientation.h>
@ -237,6 +237,18 @@ using FloatPoint = Point<float>;
}
namespace AK {
template<typename T>
struct Formatter<Gfx::Point<T>> : Formatter<StringView> {
void format(FormatBuilder& builder, const Gfx::Point<T>& value)
{
Formatter<StringView>::format(builder, value.to_string());
}
};
}
namespace IPC {
bool encode(Encoder&, const Gfx::IntPoint&);