From 9737608f0a70826804843e073d936294f925bc6e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 10 Feb 2019 06:35:40 -0600 Subject: [PATCH] Enable gradient when alias is cleared --- Marlin/src/feature/mixing.h | 2 +- Marlin/src/gcode/feature/mixing/M166.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Marlin/src/feature/mixing.h b/Marlin/src/feature/mixing.h index f5b0769546..6fc7ddecb9 100644 --- a/Marlin/src/feature/mixing.h +++ b/Marlin/src/feature/mixing.h @@ -222,7 +222,7 @@ class Mixer { // Refresh the gradient after a change static void refresh_gradient() { #if ENABLED(GRADIENT_VTOOL) - const bool is_grd = (selected_vtool == gradient.vtool_index); + const bool is_grd = (selected_vtool == gradient.vtool_index || gradient.vtool_index == -1); #else constexpr bool is_grd = true; #endif diff --git a/Marlin/src/gcode/feature/mixing/M166.cpp b/Marlin/src/gcode/feature/mixing/M166.cpp index 7f150a6868..06a40c3707 100644 --- a/Marlin/src/gcode/feature/mixing/M166.cpp +++ b/Marlin/src/gcode/feature/mixing/M166.cpp @@ -69,13 +69,12 @@ void GcodeSuite::M166() { if (parser.seen('S')) mixer.gradient.enabled = parser.value_bool(); + mixer.refresh_gradient(); + SERIAL_ECHOPGM("Gradient Mix "); serialprint_onoff(mixer.gradient.enabled); - if (mixer.gradient.enabled) { - mixer.refresh_gradient(); - #if ENABLED(GRADIENT_VTOOL) if (mixer.gradient.vtool_index >= 0) { SERIAL_ECHOPAIR(" (T", int(mixer.gradient.vtool_index));