From c9b20a0e10a438f8da8d7aabd2922ca122dc9360 Mon Sep 17 00:00:00 2001 From: SoftFever <103989404+SoftFever@users.noreply.github.com> Date: Sun, 7 May 2023 21:16:49 +0800 Subject: [PATCH] fix a regression in layer time(log) view --- src/slic3r/GUI/GCodeViewer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 3778dc1866..7c2d91f990 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -257,9 +257,12 @@ GCodeViewer::Color GCodeViewer::Extrusions::Range::get_color_at(float value) con { // Input value scaled to the colors range const float step = step_size(); - if(log_scale) + float _min = min; + if(log_scale) { value = std::log(value); - const float global_t = (step != 0.0f) ? std::max(0.0f, value - min) / step : 0.0f; // lower limit of 0.0f + _min = std::log(min); + } + const float global_t = (step != 0.0f) ? std::max(0.0f, value - _min) / step : 0.0f; // lower limit of 0.0f const size_t color_max_idx = Range_Colors.size() - 1;