Skip to content

Commit

Permalink
🩹 Fix JyersUI corner pos
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead authored and Andy-Big committed Jul 19, 2023
1 parent 66ddac2 commit 8ebaa09
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Marlin/src/lcd/e3v2/jyersui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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) {
Expand All @@ -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) {
Expand All @@ -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 },
Expand All @@ -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"));
Expand Down Expand Up @@ -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:

Expand Down

0 comments on commit 8ebaa09

Please sign in to comment.