From 4c1d867ba026cc3d91ffcd792cac19a49a0bb12d Mon Sep 17 00:00:00 2001
From: enricoturri1966 <enricoturri@seznam.cz>
Date: Mon, 23 Mar 2020 16:12:52 +0100
Subject: [PATCH] #3897 - Small optimisation in
 GCodePreviewData::RangeBase::get_color_at (thanks to rongith)

---
 src/libslic3r/GCode/PreviewData.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libslic3r/GCode/PreviewData.cpp b/src/libslic3r/GCode/PreviewData.cpp
index 874a4d2ec..8a9184e64 100644
--- a/src/libslic3r/GCode/PreviewData.cpp
+++ b/src/libslic3r/GCode/PreviewData.cpp
@@ -72,7 +72,7 @@ Color GCodePreviewData::RangeBase::get_color_at(float value) const
 {
     // Input value scaled to the color range
     float step = step_size();
-    const float global_t = (step != 0.0f) ? std::max(0.0f, value - min()) / step_size() : 0.0f; // lower limit of 0.0f
+    const float global_t = (step != 0.0f) ? std::max(0.0f, value - min()) / step : 0.0f; // lower limit of 0.0f
 
     constexpr std::size_t color_max_idx = range_rainbow_colors.size() - 1;