Browse Source

Enable gradient when alias is cleared

Scott Lahteine 6 years ago
parent
commit
9737608f0a
2 changed files with 3 additions and 4 deletions
  1. 1
    1
      Marlin/src/feature/mixing.h
  2. 2
    3
      Marlin/src/gcode/feature/mixing/M166.cpp

+ 1
- 1
Marlin/src/feature/mixing.h View File

222
     // Refresh the gradient after a change
222
     // Refresh the gradient after a change
223
     static void refresh_gradient() {
223
     static void refresh_gradient() {
224
       #if ENABLED(GRADIENT_VTOOL)
224
       #if ENABLED(GRADIENT_VTOOL)
225
-        const bool is_grd = (selected_vtool == gradient.vtool_index);
225
+        const bool is_grd = (selected_vtool == gradient.vtool_index || gradient.vtool_index == -1);
226
       #else
226
       #else
227
         constexpr bool is_grd = true;
227
         constexpr bool is_grd = true;
228
       #endif
228
       #endif

+ 2
- 3
Marlin/src/gcode/feature/mixing/M166.cpp View File

69
 
69
 
70
   if (parser.seen('S')) mixer.gradient.enabled = parser.value_bool();
70
   if (parser.seen('S')) mixer.gradient.enabled = parser.value_bool();
71
 
71
 
72
+  mixer.refresh_gradient();
73
+
72
   SERIAL_ECHOPGM("Gradient Mix ");
74
   SERIAL_ECHOPGM("Gradient Mix ");
73
   serialprint_onoff(mixer.gradient.enabled);
75
   serialprint_onoff(mixer.gradient.enabled);
74
-
75
   if (mixer.gradient.enabled) {
76
   if (mixer.gradient.enabled) {
76
 
77
 
77
-    mixer.refresh_gradient();
78
-
79
     #if ENABLED(GRADIENT_VTOOL)
78
     #if ENABLED(GRADIENT_VTOOL)
80
       if (mixer.gradient.vtool_index >= 0) {
79
       if (mixer.gradient.vtool_index >= 0) {
81
         SERIAL_ECHOPAIR(" (T", int(mixer.gradient.vtool_index));
80
         SERIAL_ECHOPAIR(" (T", int(mixer.gradient.vtool_index));

Loading…
Cancel
Save