clang-tidy readability
This commit is contained in:
@@ -11,11 +11,12 @@ UIMessage::UIMessage(std::shared_ptr<Text> text_renderer, std::string message_te
|
||||
|
||||
// Muestra el mensaje en la posición base_x, base_y con animación de entrada desde arriba
|
||||
void UIMessage::show() {
|
||||
if (visible_ && target_y_ == 0.0f)
|
||||
if (visible_ && target_y_ == 0.0F) {
|
||||
return; // Ya está visible y quieto
|
||||
}
|
||||
|
||||
start_y_ = DESP; // Empieza 8 píxeles arriba de la posición base
|
||||
target_y_ = 0.0f; // La posición final es la base
|
||||
target_y_ = 0.0F; // La posición final es la base
|
||||
y_offset_ = start_y_;
|
||||
anim_step_ = 0;
|
||||
animating_ = true;
|
||||
@@ -24,8 +25,9 @@ void UIMessage::show() {
|
||||
|
||||
// Oculta el mensaje con animación de salida hacia arriba
|
||||
void UIMessage::hide() {
|
||||
if (!visible_)
|
||||
if (!visible_) {
|
||||
return;
|
||||
}
|
||||
|
||||
start_y_ = y_offset_; // Comienza desde la posición actual
|
||||
target_y_ = DESP; // Termina 8 píxeles arriba de la base
|
||||
@@ -58,8 +60,9 @@ void UIMessage::updateAnimation() {
|
||||
if (anim_step_ >= ANIMATION_STEPS) {
|
||||
y_offset_ = target_y_;
|
||||
animating_ = false;
|
||||
if (target_y_ < 0.0f)
|
||||
if (target_y_ < 0.0F) {
|
||||
visible_ = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user