zcalibrate: fix XY offset not applied if one of them is not defined

This commit is contained in:
alfrix committed 2022-10-14 10:19:44 -03:00
1 parent 2e026aef56
commit 4b7fda9ba0
1 file changed
+3 -2
+3 -2
View File
@@ -206,9 +206,10 @@ class ZCalibratePanel(ScreenPanel):
x_offset = float(probe['x_offset'])
if "y_offset" in probe:
y_offset = float(probe['y_offset'])
if x_offset is not None and y_offset is not None:
logging.info(f"Probe offset X:{x_offset} Y:{y_offset}")
logging.info(f"Offset X:{x_offset} Y:{y_offset}")
if x_offset is not None:
x_position = x_position - x_offset
if y_offset is not None:
y_position = y_position - y_offset
logging.info(f"Moving to X:{x_position} Y:{y_position}")