Skip to content

Commit

Permalink
Clarify how the animate() and rounding() methods interact
Browse files Browse the repository at this point in the history
  • Loading branch information
YgorSouza committed Aug 12, 2023
1 parent 1d96e20 commit 1b3c235
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/egui/src/widgets/progress_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,20 @@ impl ProgressBar {
/// Whether to display a loading animation when progress `< 1`.
/// Note that this will cause the UI to be redrawn.
/// Defaults to `false`.
///
/// If [`Self::rounding`] and [`Self::animate`] are used simultaneously, the animation is not
/// rendered, since it requires a perfect circle to render correctly. However, the UI is still
/// redrawn.
pub fn animate(mut self, animate: bool) -> Self {
self.animate = animate;
self
}

/// Set the rounding of the progress bar.
/// If this option is set, the [`Self::animate`] option is ignored, since the loading animation
/// requires a perfect circle to render correctly.
///
/// If [`Self::rounding`] and [`Self::animate`] are used simultaneously, the animation is not
/// rendered, since it requires a perfect circle to render correctly. However, the UI is still
/// redrawn.
pub fn rounding(mut self, rounding: impl Into<Rounding>) -> Self {
self.rounding = Some(rounding.into());
self
Expand Down

0 comments on commit 1b3c235

Please sign in to comment.