Skip to content
Snippets Groups Projects
Commit 9fc975d5 authored by Florian Schröder's avatar Florian Schröder
Browse files

Refactor progress bar position calculation

The code for calculating the progress bar's position within the grid in gui_2d_vis/drawing.py has been clarified. Instead of directly manipulating the `pos` variable, a new `bar_pos` variable has been introduced. This revision enhances readability and maintains the integrity of the `pos` value.
parent c3acd403
No related branches found
No related tags found
No related merge requests found
Pipeline #45380 passed
......@@ -343,13 +343,13 @@ class Visualizer:
grid_size: float,
):
"""Visualize progress of progressing item as a green bar under the item."""
pos -= grid_size / 2
bar_pos = pos - (grid_size / 2)
bar_height = grid_size * 0.2
progress_width = percent * grid_size
progress_bar = pygame.Rect(
pos[0],
pos[1] + grid_size - bar_height,
bar_pos[0],
bar_pos[1] + grid_size - bar_height,
progress_width,
bar_height,
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment