From 8ebaa090e0127e434660812cf0b2c2d7630302b2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 5 Jun 2023 20:13:15 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20JyersUI=20corner=20pos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #25631 --- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 95fe61ef947b..7642166478c1 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -1392,7 +1392,7 @@ void CrealityDWINClass::Menu_Item_Handler(const uint8_t menu, const uint8_t item break; } break; - case ManualLevel: + case ManualLevel: { #define MLEVEL_BACK 0 #define MLEVEL_PROBE (MLEVEL_BACK + ENABLED(HAS_BED_PROBE)) @@ -1408,10 +1408,10 @@ void CrealityDWINClass::Menu_Item_Handler(const uint8_t menu, const uint8_t item static bool use_probe = false; #if HAS_BED_PROBE - constexpr float probe_x_min = _MAX(0 + corner_pos, X_MIN_POS + probe.offset.x, X_MIN_POS + PROBING_MARGIN) - probe.offset.x, - probe_x_max = _MIN((X_BED_SIZE + X_MIN_POS) - corner_pos, X_MAX_POS + probe.offset.x, X_MAX_POS - PROBING_MARGIN) - probe.offset.x, - probe_y_min = _MAX(0 + corner_pos, Y_MIN_POS + probe.offset.y, Y_MIN_POS + PROBING_MARGIN) - probe.offset.y, - probe_y_max = _MIN((Y_BED_SIZE + Y_MIN_POS) - corner_pos, Y_MAX_POS + probe.offset.y, Y_MAX_POS - PROBING_MARGIN) - probe.offset.y; + const float probe_x_min = _MAX(0 + corner_pos, X_MIN_POS + probe.offset.x, X_MIN_POS + PROBING_MARGIN) - probe.offset.x, + probe_x_max = _MIN((X_BED_SIZE + X_MIN_POS) - corner_pos, X_MAX_POS + probe.offset.x, X_MAX_POS - PROBING_MARGIN) - probe.offset.x, + probe_y_min = _MAX(0 + corner_pos, Y_MIN_POS + probe.offset.y, Y_MIN_POS + PROBING_MARGIN) - probe.offset.y, + probe_y_max = _MIN((Y_BED_SIZE + Y_MIN_POS) - corner_pos, Y_MAX_POS + probe.offset.y, Y_MAX_POS - PROBING_MARGIN) - probe.offset.y; #endif switch (item) { @@ -1423,6 +1423,7 @@ void CrealityDWINClass::Menu_Item_Handler(const uint8_t menu, const uint8_t item Draw_Menu(Prepare, PREPARE_MANUALLEVEL); } break; + #if HAS_BED_PROBE case MLEVEL_PROBE: if (draw) { @@ -1434,7 +1435,7 @@ void CrealityDWINClass::Menu_Item_Handler(const uint8_t menu, const uint8_t item Draw_Checkbox(row, use_probe); if (use_probe) { Popup_Handler(Level); - constexpr struct { xy_pos_t p, ProbePtRaise r } points[] = { + const struct { xy_pos_t p; ProbePtRaise r; } points[] = { { { probe_x_min, probe_y_min }, PROBE_PT_RAISE }, { { probe_x_min, probe_y_max }, PROBE_PT_RAISE }, { { probe_x_max, probe_y_max }, PROBE_PT_RAISE }, @@ -1452,6 +1453,7 @@ void CrealityDWINClass::Menu_Item_Handler(const uint8_t menu, const uint8_t item } break; #endif + case MLEVEL_BL: if (draw) Draw_Menu_Item(row, ICON_AxisBL, F("Bottom Left")); @@ -1566,7 +1568,9 @@ void CrealityDWINClass::Menu_Item_Handler(const uint8_t menu, const uint8_t item Modify_Value(mlev_z_pos, 0, MAX_Z_OFFSET, 100); break; } - break; + + } break; + #if HAS_ZOFFSET_ITEM case ZOffset: