From 044634d7d1ab2571a5a409e99d000324d79f8a57 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Thu, 13 May 2021 09:47:44 +0200 Subject: [PATCH] Fixed "Extruder sequence", when extruder changes are per mm --- src/slic3r/GUI/DoubleSlider.cpp | 6 +++--- src/slic3r/GUI/DoubleSlider.hpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/DoubleSlider.cpp b/src/slic3r/GUI/DoubleSlider.cpp index 655ef496b..a10acb2e3 100644 --- a/src/slic3r/GUI/DoubleSlider.cpp +++ b/src/slic3r/GUI/DoubleSlider.cpp @@ -326,10 +326,10 @@ double Control::get_double_value(const SelectedSlider& selection) return m_values[selection == ssLower ? m_lower_value : m_higher_value]; } -int Control::get_tick_from_value(double value) +int Control::get_tick_from_value(double value, bool force_lower_bound/* = false*/) { std::vector::iterator it; - if (m_is_wipe_tower) + if (m_is_wipe_tower && !force_lower_bound) it = std::find_if(m_values.begin(), m_values.end(), [value](const double & val) { return fabs(value - val) <= epsilon(); }); else @@ -2395,7 +2395,7 @@ void Control::edit_extruder_sequence() extruder = 0; if (m_extruders_sequence.is_mm_intervals) { value += m_extruders_sequence.interval_by_mm; - tick = get_tick_from_value(value); + tick = get_tick_from_value(value, true); if (tick < 0) break; } diff --git a/src/slic3r/GUI/DoubleSlider.hpp b/src/slic3r/GUI/DoubleSlider.hpp index 439b03a50..400265885 100644 --- a/src/slic3r/GUI/DoubleSlider.hpp +++ b/src/slic3r/GUI/DoubleSlider.hpp @@ -322,7 +322,7 @@ private: wxSize get_size() const; void get_size(int* w, int* h) const; double get_double_value(const SelectedSlider& selection); - int get_tick_from_value(double value); + int get_tick_from_value(double value, bool force_lower_bound = false); wxString get_tooltip(int tick = -1); int get_edited_tick_for_position(wxPoint pos, Type type = ColorChange);