test: verificar pre-commit hook (clang-format + clang-tidy)
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
// vector_text.cpp - Implementació del sistema de text vectorial
|
// vector_text.cpp - Implementació del sistema de text vectorial
|
||||||
// © 2025 Port a C++20 amb SDL3
|
// © 2025 Port a C++20 amb SDL3
|
||||||
|
// Test pre-commit hook
|
||||||
|
|
||||||
#include "core/graphics/vector_text.hpp"
|
#include "core/graphics/vector_text.hpp"
|
||||||
|
|
||||||
@@ -181,7 +182,7 @@ bool VectorText::is_supported(char c) const {
|
|||||||
return chars_.contains(c);
|
return chars_.contains(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VectorText::render(const std::string& text, const Punt& posicio, float escala, float spacing, float brightness) {
|
void VectorText::render(const std::string& text, const Punt& posicio, float escala, float spacing, float brightness) const {
|
||||||
if (renderer_ == nullptr) {
|
if (renderer_ == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -236,7 +237,7 @@ void VectorText::render(const std::string& text, const Punt& posicio, float esca
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VectorText::render_centered(const std::string& text, const Punt& centre_punt, float escala, float spacing, float brightness) {
|
void VectorText::render_centered(const std::string& text, const Punt& centre_punt, float escala, float spacing, float brightness) const {
|
||||||
// Calcular dimensions del text
|
// Calcular dimensions del text
|
||||||
float text_width = get_text_width(text, escala, spacing);
|
float text_width = get_text_width(text, escala, spacing);
|
||||||
float text_height = get_text_height(escala);
|
float text_height = get_text_height(escala);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class VectorText {
|
|||||||
// - escala: factor de escala (1.0 = 20×40 px por carácter)
|
// - escala: factor de escala (1.0 = 20×40 px por carácter)
|
||||||
// - spacing: espacio entre caracteres en píxeles (a escala 1.0)
|
// - spacing: espacio entre caracteres en píxeles (a escala 1.0)
|
||||||
// - brightness: factor de brillantor (0.0-1.0, default 1.0 = màxima brillantor)
|
// - brightness: factor de brillantor (0.0-1.0, default 1.0 = màxima brillantor)
|
||||||
void render(const std::string& text, const Punt& posicio, float escala = 1.0F, float spacing = 2.0F, float brightness = 1.0F);
|
void render(const std::string& text, const Punt& posicio, float escala = 1.0F, float spacing = 2.0F, float brightness = 1.0F) const;
|
||||||
|
|
||||||
// Renderizar string centrado en un punto
|
// Renderizar string centrado en un punto
|
||||||
// - text: cadena a renderizar
|
// - text: cadena a renderizar
|
||||||
@@ -33,7 +33,7 @@ class VectorText {
|
|||||||
// - escala: factor de escala (1.0 = 20×40 px por carácter)
|
// - escala: factor de escala (1.0 = 20×40 px por carácter)
|
||||||
// - spacing: espacio entre caracteres en píxeles (a escala 1.0)
|
// - spacing: espacio entre caracteres en píxeles (a escala 1.0)
|
||||||
// - brightness: factor de brillantor (0.0-1.0, default 1.0 = màxima brillantor)
|
// - brightness: factor de brillantor (0.0-1.0, default 1.0 = màxima brillantor)
|
||||||
void render_centered(const std::string& text, const Punt& centre_punt, float escala = 1.0F, float spacing = 2.0F, float brightness = 1.0F);
|
void render_centered(const std::string& text, const Punt& centre_punt, float escala = 1.0F, float spacing = 2.0F, float brightness = 1.0F) const;
|
||||||
|
|
||||||
// Calcular ancho total de un string (útil para centrado)
|
// Calcular ancho total de un string (útil para centrado)
|
||||||
[[nodiscard]] float get_text_width(const std::string& text, float escala = 1.0F, float spacing = 2.0F) const;
|
[[nodiscard]] float get_text_width(const std::string& text, float escala = 1.0F, float spacing = 2.0F) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user