ladybird/Userland/Libraries/LibGfx/Triangle.cpp
Andreas Kling 1f346a490b LibGfx: Templatize Gfx::Triangle
Previously this was limited to integer triangles, but I want to use it
with floats, so let's start by templatizing the class.
2022-04-07 17:06:02 +02:00

25 lines
482 B
C++

/*
* Copyright (c) 2020, Shannon Booth <shannon.ml.booth@gmail.com>
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/String.h>
#include <LibGfx/Triangle.h>
namespace Gfx {
template<>
String Triangle<int>::to_string() const
{
return String::formatted("({},{},{})", m_a, m_b, m_c);
}
template<>
String Triangle<float>::to_string() const
{
return String::formatted("({},{},{})", m_a, m_b, m_c);
}
}