mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Fix crash in similation view
CURA-11758
This commit is contained in:
parent
d441130e3b
commit
1046b24ee5
2 changed files with 5 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
# Copyright (c) 2021 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
import math
|
||||
import sys
|
||||
|
||||
from PyQt6.QtCore import Qt
|
||||
|
@ -216,7 +217,8 @@ class SimulationView(CuraView):
|
|||
Logger.warn(
|
||||
f"Binary search error (out of bounds): index {i}: left value {left_value} right value {right_value} and current time is {self._current_time}")
|
||||
|
||||
fractional_value = (self._current_time - left_value) / (right_value - left_value)
|
||||
segment_duration = right_value - left_value
|
||||
fractional_value = 0.0 if segment_duration == 0.0 else (self._current_time - left_value) / segment_duration
|
||||
|
||||
self.setPath(i + fractional_value)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue