From c5cb94d92c03985ce90d2781c57ecf9284e7fd22 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Wed, 16 Jun 2021 18:20:26 +0200 Subject: [PATCH] Follow up https://github.com/prusa3d/PrusaSlicer/commit/0b5ea8f429d13d7d2a3feed56cf30b980d449653 - Un-select random sequence by default - Added a check for interval height. It have to be bigger then print layer height --- src/slic3r/GUI/DoubleSlider.hpp | 2 +- src/slic3r/GUI/ExtruderSequenceDialog.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/DoubleSlider.hpp b/src/slic3r/GUI/DoubleSlider.hpp index 4c7c3e1bb..36fa7b660 100644 --- a/src/slic3r/GUI/DoubleSlider.hpp +++ b/src/slic3r/GUI/DoubleSlider.hpp @@ -146,7 +146,7 @@ struct ExtrudersSequence bool is_mm_intervals = true; double interval_by_mm = 3.0; int interval_by_layers = 10; - bool random_sequence { true }; + bool random_sequence { false }; bool color_repetition { false }; std::vector extruders = { 0 }; diff --git a/src/slic3r/GUI/ExtruderSequenceDialog.cpp b/src/slic3r/GUI/ExtruderSequenceDialog.cpp index 4099d62c7..4a0600e53 100644 --- a/src/slic3r/GUI/ExtruderSequenceDialog.cpp +++ b/src/slic3r/GUI/ExtruderSequenceDialog.cpp @@ -91,7 +91,8 @@ ExtruderSequenceDialog::ExtruderSequenceDialog(const DoubleSlider::ExtrudersSequ double_to_string(sequence.interval_by_mm), wxDefaultPosition, editor_sz, wxTE_PROCESS_ENTER); - auto change_value = [this]() + double min_layer_height = wxGetApp().preset_bundle->prints.get_edited_preset().config.opt_float("layer_height"); + auto change_value = [this, min_layer_height]() { wxString str = m_interval_by_mm->GetValue(); if (str.IsEmpty()) { @@ -112,6 +113,11 @@ ExtruderSequenceDialog::ExtruderSequenceDialog(const DoubleSlider::ExtrudersSequ if (fabs(m_sequence.interval_by_layers - val) < 0.001) return; + if (val < min_layer_height) { + val = min_layer_height; + m_interval_by_mm->SetValue(double_to_string(val, 2)); + } + m_sequence.interval_by_mm = val; };