mirror of
https://github.com/rr-/pq-cli.git
synced 2026-09-29 14:54:00 -06:00
mechanic: fix simulation stopping under certain conditions
This commit is contained in:
+3
-2
@@ -75,9 +75,10 @@ class Bar(SignalMixin):
|
||||
return self._position >= self.max_
|
||||
|
||||
def reposition(self, new_pos: float) -> None:
|
||||
old_pos = self._position
|
||||
new_pos = float(min(new_pos, self._max))
|
||||
if not math.isclose(new_pos, self._position):
|
||||
self._position = new_pos
|
||||
self._position = new_pos
|
||||
if not math.isclose(new_pos, old_pos):
|
||||
self.emit("change")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user