Fix: Las notificaciones ya se apilan correctamente

This commit is contained in:
2022-11-16 07:43:04 +01:00
parent a0042b91cc
commit 2d0b579425

View File

@@ -30,7 +30,7 @@ Notify::~Notify()
// Dibuja las notificaciones por pantalla // Dibuja las notificaciones por pantalla
void Notify::render() void Notify::render()
{ {
for (int i = 0; i < (int)notifications.size(); ++i) for (int i = (int)notifications.size() - 1; i >= 0; --i)
{ {
notifications.at(i).sprite->render(); notifications.at(i).sprite->render();
} }
@@ -112,7 +112,8 @@ void Notify::showText(std::string text)
const int despH = this->text->getCharacterSize() / 2; const int despH = this->text->getCharacterSize() / 2;
const int despV = despH; const int despV = despH;
const int travelDist = height + despV; const int travelDist = height + despV;
const int offset = (int)notifications.size() * (travelDist) + despV; // const int offset = (int)notifications.size() * (travelDist) + despV;
const int offset = (int)notifications.size() > 0 ? notifications.back().y + travelDist : despV;
// Crea la notificacion // Crea la notificacion
notification_t n; notification_t n;