i per fi ja comença a tornar tot a la normalitat

This commit is contained in:
2025-03-05 20:52:34 +01:00
parent 5a8747cc4b
commit 241732752a
25 changed files with 75 additions and 81 deletions

View File

@@ -146,9 +146,9 @@ std::shared_ptr<Surface> Text::writeToSurface(const std::string &text, int zoom,
{
auto width = lenght(text, kerning) * zoom;
auto height = box_height_ * zoom;
auto surface = std::make_shared<Surface>(Screen::get()->getRendererSurface(), width, height);
auto surface = std::make_shared<Surface>(width, height);
Screen::get()->setRendererSurface(surface);
Screen::get()->clearSurface(stringToColor("transparent"));
surface->clear(stringToColor("transparent"));
write(0, 0, text, kerning);
Screen::get()->setRendererSurface(nullptr);
@@ -160,9 +160,9 @@ std::shared_ptr<Surface> Text::writeDXToSurface(Uint8 flags, const std::string &
{
auto width = Text::lenght(text, kerning) + shadow_distance;
auto height = box_height_ + shadow_distance;
auto surface = std::make_shared<Surface>(Screen::get()->getRendererSurface(), width, height);
auto surface = std::make_shared<Surface>(width, height);
Screen::get()->setRendererSurface(surface);
Screen::get()->clearSurface(stringToColor("transparent"));
surface->clear(stringToColor("transparent"));
writeDX(flags, 0, 0, text, kerning, textColor, shadow_distance, shadow_color, lenght);
Screen::get()->setRendererSurface(nullptr);