Skip to content

Commit 798ae21

Browse files
authored
fix slider calculates wrong x value when min_value > 0 (#2359)
1 parent d4947c9 commit 798ae21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arcade/gui/widgets/slider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def _x_for_value(self, value: float):
9898
"""Provides the x coordinate for the given value."""
9999

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

104104
@property

0 commit comments

Comments
 (0)