Ver código fonte

Center ABL grid on bed with H parameter. (#12610)

MasterPIC 6 anos atrás
pai
commit
3bb8b3529a
1 arquivos alterados com 4 adições e 4 exclusões
  1. 4
    4
      Marlin/src/gcode/bedlevel/abl/G29.cpp

+ 4
- 4
Marlin/src/gcode/bedlevel/abl/G29.cpp Ver arquivo

@@ -385,10 +385,10 @@ G29_TYPE GcodeSuite::G29() {
385 385
 
386 386
       if (parser.seen('H')) {
387 387
         const int16_t size = (int16_t)parser.value_linear_units();
388
-        left_probe_bed_position  = MAX((MIN_PROBE_X + MAX_PROBE_X - size) / 2, MIN_PROBE_X);
389
-        right_probe_bed_position = MIN(left_probe_bed_position + size,         MAX_PROBE_X);
390
-        front_probe_bed_position = MAX((MIN_PROBE_Y + MAX_PROBE_Y - size) / 2, MIN_PROBE_Y);
391
-        back_probe_bed_position  = MIN(front_probe_bed_position + size,        MAX_PROBE_Y);
388
+        left_probe_bed_position  = MAX(X_CENTER - size / 2, MIN_PROBE_X);
389
+        right_probe_bed_position = MIN(left_probe_bed_position + size, MAX_PROBE_X);
390
+        front_probe_bed_position = MAX(Y_CENTER - size / 2, MIN_PROBE_Y);
391
+        back_probe_bed_position  = MIN(front_probe_bed_position + size, MAX_PROBE_Y);
392 392
       }
393 393
       else {
394 394
         left_probe_bed_position  = parser.seenval('L') ? (int)RAW_X_POSITION(parser.value_linear_units()) : LEFT_PROBE_BED_POSITION;

Carregando…
Cancelar
Salvar