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

@@ -234,32 +234,31 @@ void Notifier::show(std::vector<std::string> texts, NotificationText text_is, in
n.rect = {desp_h, y_pos, width, height};
// Crea la textura
n.surface = std::make_shared<Surface>(Screen::get()->getRendererSurface(), width, height);
n.surface = std::make_shared<Surface>(width, height);
// Prepara para dibujar en la textura
Screen::get()->setRendererSurface(n.surface);
// Dibuja el fondo de la notificación
SDL_Rect rect;
auto surface = Screen::get()->getRendererSurface();
if (shape == NotificationShape::ROUNDED)
{
rect = {4, 0, width - (4 * 2), height};
surface->fillRect(&rect, bg_color_);
n.surface->fillRect(&rect, bg_color_);
rect = {4 / 2, 1, width - 4, height - 2};
surface->fillRect(&rect, bg_color_);
n.surface->fillRect(&rect, bg_color_);
rect = {1, 4 / 2, width - 2, height - 4};
surface->fillRect(&rect, bg_color_);
n.surface->fillRect(&rect, bg_color_);
rect = {0, 4, width, height - (4 * 2)};
surface->fillRect(&rect, bg_color_);
n.surface->fillRect(&rect, bg_color_);
}
else if (shape == NotificationShape::SQUARED)
{
Screen::get()->clearSurface(bg_color_);
n.surface->clear(bg_color_);
}
// Dibuja el icono de la notificación