jugant amb clang-tidy
This commit is contained in:
@@ -66,15 +66,15 @@ void Notifier::update() {
|
||||
|
||||
// Comprueba los estados
|
||||
if (notifications_[i].state == NotificationStatus::RISING) {
|
||||
const float step = ((float)notifications_[i].counter / notifications_[i].travel_dist);
|
||||
const int alpha = 255 * step;
|
||||
const float STEP = ((float)notifications_[i].counter / notifications_[i].travel_dist);
|
||||
const int ALPHA = 255 * STEP;
|
||||
|
||||
if (param.notification.pos_v == NotifyPosition::TOP) {
|
||||
notifications_[i].rect.y++;
|
||||
} else {
|
||||
notifications_[i].rect.y--;
|
||||
}
|
||||
notifications_[i].texture->setAlpha(alpha);
|
||||
notifications_[i].texture->setAlpha(ALPHA);
|
||||
|
||||
if (notifications_[i].rect.y == notifications_[i].y) {
|
||||
notifications_[i].state = NotificationStatus::STAY;
|
||||
@@ -89,15 +89,15 @@ void Notifier::update() {
|
||||
notifications_[i].counter = 0;
|
||||
}
|
||||
} else if (notifications_[i].state == NotificationStatus::VANISHING) {
|
||||
const float step = (notifications_[i].counter / (float)notifications_[i].travel_dist);
|
||||
const int alpha = 255 * (1 - step);
|
||||
const float STEP = (notifications_[i].counter / (float)notifications_[i].travel_dist);
|
||||
const int ALPHA = 255 * (1 - STEP);
|
||||
|
||||
if (param.notification.pos_v == NotifyPosition::TOP) {
|
||||
notifications_[i].rect.y--;
|
||||
} else {
|
||||
notifications_[i].rect.y++;
|
||||
}
|
||||
notifications_[i].texture->setAlpha(alpha);
|
||||
notifications_[i].texture->setAlpha(ALPHA);
|
||||
|
||||
if (notifications_[i].rect.y == notifications_[i].y - notifications_[i].travel_dist) {
|
||||
notifications_[i].state = NotificationStatus::FINISHED;
|
||||
@@ -176,7 +176,7 @@ void Notifier::show(std::vector<std::string> texts, int icon, const std::string
|
||||
|
||||
// Offset
|
||||
const auto TRAVEL_DIST = HEIGHT + PADDING_OUT;
|
||||
auto OFFSET = notifications_.empty()
|
||||
auto offset = notifications_.empty()
|
||||
? DESP_V
|
||||
: notifications_.back().y + (param.notification.pos_v == NotifyPosition::TOP ? TRAVEL_DIST : -TRAVEL_DIST);
|
||||
|
||||
@@ -185,11 +185,11 @@ void Notifier::show(std::vector<std::string> texts, int icon, const std::string
|
||||
|
||||
// Inicializa variables
|
||||
n.code = code;
|
||||
n.y = OFFSET;
|
||||
n.y = offset;
|
||||
n.travel_dist = TRAVEL_DIST;
|
||||
n.texts = texts;
|
||||
n.shape = SHAPE;
|
||||
const float POS_Y = OFFSET + (param.notification.pos_v == NotifyPosition::TOP ? -TRAVEL_DIST : TRAVEL_DIST);
|
||||
const float POS_Y = offset + (param.notification.pos_v == NotifyPosition::TOP ? -TRAVEL_DIST : TRAVEL_DIST);
|
||||
n.rect = {desp_h, POS_Y, WIDTH, HEIGHT};
|
||||
|
||||
// Crea la textura
|
||||
@@ -234,10 +234,10 @@ void Notifier::show(std::vector<std::string> texts, int icon, const std::string
|
||||
}
|
||||
|
||||
// Escribe el texto de la notificación
|
||||
const Color color{255, 255, 255};
|
||||
const Color COLOR{255, 255, 255};
|
||||
int iterator = 0;
|
||||
for (const auto &text : texts) {
|
||||
text_->writeColored(PADDING_IN_H + ICON_SPACE, PADDING_IN_V + iterator * (text_->getCharacterSize() + 1), text, color);
|
||||
text_->writeColored(PADDING_IN_H + ICON_SPACE, PADDING_IN_V + iterator * (text_->getCharacterSize() + 1), text, COLOR);
|
||||
++iterator;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user