linter: varios
This commit is contained in:
@@ -119,7 +119,7 @@ void Scoreboard::setCarouselAnimation(Id id, int selected_index, EnterName* ente
|
||||
}
|
||||
|
||||
// ===== Bloquear si aún animando =====
|
||||
if (std::abs(carousel_position_.at(idx) - carousel_target_.at(idx)) > 0.01f) {
|
||||
if (std::abs(carousel_position_.at(idx) - carousel_target_.at(idx)) > 0.01F) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -755,7 +755,7 @@ void Scoreboard::renderCarousel(size_t panel_index, int center_x, int y) {
|
||||
}
|
||||
|
||||
const float FRACTIONAL_OFFSET = frac;
|
||||
const int PIXEL_OFFSET = static_cast<int>(FRACTIONAL_OFFSET * CHAR_STEP + 0.5f);
|
||||
const int PIXEL_OFFSET = static_cast<int>((FRACTIONAL_OFFSET * CHAR_STEP) + 0.5F);
|
||||
|
||||
// Índice base en la lista de caracteres (posición central)
|
||||
const int BASE_INDEX = static_cast<int>(std::floor(carousel_pos));
|
||||
@@ -774,11 +774,14 @@ void Scoreboard::renderCarousel(size_t panel_index, int center_x, int y) {
|
||||
|
||||
// --- Calcular distancia circular correcta (corregido el bug de wrap) ---
|
||||
float normalized_pos = std::fmod(carousel_pos, static_cast<float>(CHAR_LIST_SIZE));
|
||||
if (normalized_pos < 0.0F) normalized_pos += static_cast<float>(CHAR_LIST_SIZE);
|
||||
if (normalized_pos < 0.0F) {
|
||||
normalized_pos += static_cast<float>(CHAR_LIST_SIZE);
|
||||
}
|
||||
|
||||
float diff = std::abs(static_cast<float>(char_index) - normalized_pos);
|
||||
if (diff > static_cast<float>(CHAR_LIST_SIZE) / 2.0F)
|
||||
if (diff > static_cast<float>(CHAR_LIST_SIZE) / 2.0F) {
|
||||
diff = static_cast<float>(CHAR_LIST_SIZE) - diff;
|
||||
}
|
||||
|
||||
const float DISTANCE_FROM_CENTER = diff;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user