diff --git a/src/textual/widgets/_progress_bar.py b/src/textual/widgets/_progress_bar.py index 669df2e90d..e11861e291 100644 --- a/src/textual/widgets/_progress_bar.py +++ b/src/textual/widgets/_progress_bar.py @@ -127,7 +127,11 @@ def render_indeterminate(self) -> RenderResult: else: speed = 30 # Cells per second. # Compute the position of the bar. - start = (speed * self._clock.time) % (2 * total_imaginary_width) + start = ( + (speed * self._clock.time) % (2 * total_imaginary_width) + if total_imaginary_width != 0.0 + else 0.0 + ) if start > total_imaginary_width: # If the bar is to the right of its width, wrap it back from right to left. start = 2 * total_imaginary_width - start # = (tiw - (start - tiw))