Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions harbor-ui/src/components/spinner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,14 @@ impl Animation {
rotation: rotation.wrapping_add(additional_rotation),
last: now,
},
Self::Contracting { rotation, .. } => {
Self::Expanding {
start: now,
progress: 0.0,
rotation: rotation.wrapping_add(BASE_ROTATION_SPEED.wrapping_add(
(f64::from(WRAP_ANGLE / (2.0 * Radians::PI)) * f64::MAX) as u32,
)),
last: now,
}
}
Self::Contracting { rotation, .. } => Self::Expanding {
start: now,
progress: 0.0,
rotation: rotation.wrapping_add(BASE_ROTATION_SPEED.wrapping_add(
(f64::from(WRAP_ANGLE / (2.0 * Radians::PI)) * u32::MAX as f64) as u32,
Copy link

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original code used f64::MAX which is much larger than u32::MAX and would cause overflow when cast to u32. The fix correctly uses u32::MAX as f64 to prevent this overflow and ensure proper rotation calculations.

Copilot uses AI. Check for mistakes.
)),
last: now,
},
}
}

Expand Down
Loading