Parcourir la source

Fix for bilinear grid outside bounds

Scott Lahteine il y a 8 ans
Parent
révision
f0d673561f
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2
    2
      Marlin/Marlin_main.cpp

+ 2
- 2
Marlin/Marlin_main.cpp Voir le fichier

@@ -8313,8 +8313,8 @@ void ok_to_send() {
8313 8313
     // Whole unit is the grid box index
8314 8314
     const int gridx = constrain(floor(ratio_x), 0, ABL_GRID_POINTS_X - 2),
8315 8315
               gridy = constrain(floor(ratio_y), 0, ABL_GRID_POINTS_Y - 2),
8316
-              nextx = gridx + (x < PROBE_BED_WIDTH ? 1 : 0),
8317
-              nexty = gridy + (y < PROBE_BED_HEIGHT ? 1 : 0);
8316
+              nextx = min(gridx + 1, ABL_GRID_POINTS_X - 2),
8317
+              nexty = min(gridy + 1, ABL_GRID_POINTS_Y - 2);
8318 8318
 
8319 8319
     // Subtract whole to get the ratio within the grid box
8320 8320
     ratio_x = constrain(ratio_x - gridx, 0.0, 1.0);

Chargement…
Annuler
Enregistrer