From 270231a0049ffec268c3436b2a55ec222df4a52c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Fri, 19 Dec 2014 09:54:11 +0100 Subject: [PATCH] Fixed extruder offsets not being properly editable in printer profiles Closes #677 --- src/octoprint/server/api/printer_profiles.py | 2 +- src/octoprint/static/js/app/viewmodels/printerprofiles.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/octoprint/server/api/printer_profiles.py b/src/octoprint/server/api/printer_profiles.py index 5f04fa7b..8cd8d0ac 100644 --- a/src/octoprint/server/api/printer_profiles.py +++ b/src/octoprint/server/api/printer_profiles.py @@ -146,7 +146,7 @@ def _validate_profile(profile): converted_offsets = [] for offset in profile["extruder"]["offsets"]: try: - converted_offsets.append((float(offset[0]), float(offset[0]))) + converted_offsets.append((float(offset[0]), float(offset[1]))) except: return False profile["extruder"]["offsets"] = converted_offsets diff --git a/src/octoprint/static/js/app/viewmodels/printerprofiles.js b/src/octoprint/static/js/app/viewmodels/printerprofiles.js index f6675a4e..7dd954af 100644 --- a/src/octoprint/static/js/app/viewmodels/printerprofiles.js +++ b/src/octoprint/static/js/app/viewmodels/printerprofiles.js @@ -301,7 +301,7 @@ function PrinterProfilesViewModel() { for (var i = 1; i < self.editorExtruders(); i++) { var offset = [0.0, 0.0]; if (i < self.editorExtruderOffsets().length) { - offset = self.editorExtruderOffsets()[i]; + offset = [parseFloat(self.editorExtruderOffsets()[i]["x"]()), parseFloat(self.editorExtruderOffsets()[i]["y"]())]; } profile.extruder.offsets.push(offset); }