|
@@ -1133,11 +1133,9 @@
|
1133
|
1133
|
err_flag = true;
|
1134
|
1134
|
}
|
1135
|
1135
|
|
1136
|
|
- if (!WITHIN(RAW_X_POSITION(g29_x_pos), X_MIN_BED, X_MAX_BED)) // if X & Y are not valid, use center of the bed values
|
1137
|
|
- g29_x_pos = (X_MIN_BED + X_MAX_BED) / 2.0;
|
1138
|
|
-
|
1139
|
|
- if (!WITHIN(RAW_Y_POSITION(g29_y_pos), Y_MIN_BED, Y_MAX_BED)) // if X & Y are not valid, use center of the bed values
|
1140
|
|
- g29_y_pos = (Y_MIN_BED + Y_MAX_BED) / 2.0;
|
|
1136
|
+ // If X or Y are not valid, use center of the bed values
|
|
1137
|
+ if (!WITHIN(RAW_X_POSITION(g29_x_pos), X_MIN_BED, X_MAX_BED)) g29_x_pos = LOGICAL_X_POSITION(X_CENTER);
|
|
1138
|
+ if (!WITHIN(RAW_Y_POSITION(g29_y_pos), Y_MIN_BED, Y_MAX_BED)) g29_y_pos = LOGICAL_Y_POSITION(Y_CENTER);
|
1141
|
1139
|
|
1142
|
1140
|
if (err_flag) return UBL_ERR;
|
1143
|
1141
|
|