diff --git a/source/core/graphics/vector_text.cpp b/source/core/graphics/vector_text.cpp index 9cdb0aa..80ce303 100644 --- a/source/core/graphics/vector_text.cpp +++ b/source/core/graphics/vector_text.cpp @@ -1,5 +1,6 @@ // vector_text.cpp - Implementació del sistema de text vectorial // © 2025 Port a C++20 amb SDL3 +// Test pre-commit hook #include "core/graphics/vector_text.hpp" @@ -181,7 +182,7 @@ bool VectorText::is_supported(char c) const { 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) { 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 float text_width = get_text_width(text, escala, spacing); float text_height = get_text_height(escala); diff --git a/source/core/graphics/vector_text.hpp b/source/core/graphics/vector_text.hpp index 352bfd6..eacddb4 100644 --- a/source/core/graphics/vector_text.hpp +++ b/source/core/graphics/vector_text.hpp @@ -25,7 +25,7 @@ class VectorText { // - escala: factor de escala (1.0 = 20×40 px por carácter) // - 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) - 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 // - text: cadena a renderizar @@ -33,7 +33,7 @@ class VectorText { // - escala: factor de escala (1.0 = 20×40 px por carácter) // - 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) - 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) [[nodiscard]] float get_text_width(const std::string& text, float escala = 1.0F, float spacing = 2.0F) const;