Skip to content

Commit

Permalink
fix slider calculates wrong x value when min_value > 0 (#2359)
Browse files Browse the repository at this point in the history
  • Loading branch information
eruvanos authored Sep 2, 2024
1 parent d4947c9 commit 798ae21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arcade/gui/widgets/slider.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def _x_for_value(self, value: float):
"""Provides the x coordinate for the given value."""

x = self.content_rect.left
val = (value - self.min_value) / self.max_value
val = (value - self.min_value) / (self.max_value - self.min_value)
return x + self._cursor_width + val * (self.content_width - 2 * self._cursor_width)

@property
Expand Down

0 comments on commit 798ae21

Please sign in to comment.