From b5bc4aecd5b1beeeb50ac4aa973c846f97da743d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Sat, 3 Apr 2021 16:56:36 +0200 Subject: [PATCH] Reset color scheme limits before every recalculation This prevents previous measurements from influencing the colour scheme. Essentially previously it was showing the colour scheme based on all lines you had ever seen, rather than just the line types you were currently seeing. --- plugins/SimulationView/SimulationView.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/SimulationView/SimulationView.py b/plugins/SimulationView/SimulationView.py index d116b10597..824da0f60a 100644 --- a/plugins/SimulationView/SimulationView.py +++ b/plugins/SimulationView/SimulationView.py @@ -221,12 +221,6 @@ class SimulationView(CuraView): def resetLayerData(self) -> None: self._current_layer_mesh = None self._current_layer_jumps = None - self._max_feedrate = sys.float_info.min - self._min_feedrate = sys.float_info.max - self._max_thickness = sys.float_info.min - self._min_thickness = sys.float_info.max - self._max_line_width = sys.float_info.min - self._min_line_width = sys.float_info.max def beginRendering(self) -> None: scene = self.getController().getScene() @@ -474,6 +468,13 @@ class SimulationView(CuraView): old_min_thickness = self._min_thickness old_max_thickness = self._max_thickness + self._min_feedrate = sys.float_info.max + self._max_feedrate = sys.float_info.min + self._min_line_width = sys.float_info.max + self._max_line_width = sys.float_info.min + self._min_thickness = sys.float_info.max + self._max_thickness = sys.float_info.min + # The colour scheme is only influenced by the visible lines, so filter the lines by if they should be visible. visible_line_types = [] if self.getShowSkin(): # Actually "shell".