Skip to content

Commit bff55ea

Browse files
committed
🐛 Fix UBL 'G29 Q1' bug
1 parent 623c6b7 commit bff55ea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Marlin/src/feature/bedlevel/ubl/ubl_G29.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -367,13 +367,13 @@ void unified_bed_leveling::G29() {
367367

368368
case 1:
369369
LOOP_L_N(x, GRID_MAX_POINTS_X) { // Create a diagonal line several Mesh cells thick that is raised
370+
const uint8_t x2 = x + (x < (GRID_MAX_POINTS_Y) - 1 ? 1 : -1);
370371
z_values[x][x] += 9.999f;
371-
z_values[x][x + (x < (GRID_MAX_POINTS_Y) - 1) ? 1 : -1] += 9.999f; // We want the altered line several mesh points thick
372+
z_values[x][x2] += 9.999f; // We want the altered line several mesh points thick
372373
#if ENABLED(EXTENSIBLE_UI)
373374
ExtUI::onMeshUpdate(x, x, z_values[x][x]);
374-
ExtUI::onMeshUpdate(x, (x + (x < (GRID_MAX_POINTS_Y) - 1) ? 1 : -1), z_values[x][x + (x < (GRID_MAX_POINTS_Y) - 1) ? 1 : -1]);
375+
ExtUI::onMeshUpdate(x, (x2), z_values[x][x2]);
375376
#endif
376-
377377
}
378378
break;
379379

0 commit comments

Comments
 (0)