From c91f3a78845853b83d583db75faee09031f6c608 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 16 Aug 2021 13:44:00 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20displayed=20mix=20percenta?= =?UTF-8?q?ges?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/mixing.cpp | 2 -- Marlin/src/feature/mixing.h | 3 +-- Marlin/src/lcd/menu/menu_mixer.cpp | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Marlin/src/feature/mixing.cpp b/Marlin/src/feature/mixing.cpp index b1a069e3205e..cf88b806f542 100644 --- a/Marlin/src/feature/mixing.cpp +++ b/Marlin/src/feature/mixing.cpp @@ -24,8 +24,6 @@ #if ENABLED(MIXING_EXTRUDER) -//#define MIXER_NORMALIZER_DEBUG - #include "mixing.h" Mixer mixer; diff --git a/Marlin/src/feature/mixing.h b/Marlin/src/feature/mixing.h index 85d52d69c8f3..3a14fdad5975 100644 --- a/Marlin/src/feature/mixing.h +++ b/Marlin/src/feature/mixing.h @@ -148,8 +148,7 @@ class Mixer { static void update_mix_from_vtool(const uint8_t j=selected_vtool) { float ctot = 0; MIXER_STEPPER_LOOP(i) ctot += color[j][i]; - //MIXER_STEPPER_LOOP(i) mix[i] = 100.0f * color[j][i] / ctot; - MIXER_STEPPER_LOOP(i) mix[i] = mixer_perc_t(100.0f * color[j][i] / ctot); + MIXER_STEPPER_LOOP(i) mix[i] = mixer_perc_t(100.0f * color[j][i] / ctot + 0.5f); #ifdef MIXER_NORMALIZER_DEBUG SERIAL_ECHOPGM("V-tool ", j, " [ "); diff --git a/Marlin/src/lcd/menu/menu_mixer.cpp b/Marlin/src/lcd/menu/menu_mixer.cpp index f18c5bbfebb9..f787d47d0f4d 100644 --- a/Marlin/src/lcd/menu/menu_mixer.cpp +++ b/Marlin/src/lcd/menu/menu_mixer.cpp @@ -112,7 +112,7 @@ static uint8_t v_index; #if HAS_DUAL_MIXING void _lcd_draw_mix(const uint8_t y) { char tmp[20]; // "100%_100%" - sprintf_P(tmp, PSTR("%3d%% %3d%%"), int(mixer.mix[0]), int(mixer.mix[1])); + sprintf_P(tmp, PSTR("%3d%% %3d%% "), int(mixer.mix[0]), int(mixer.mix[1])); SETCURSOR(2, y); lcd_put_u8str(GET_TEXT_F(MSG_MIX)); SETCURSOR_RJ(10, y); lcd_put_u8str(tmp); }