From 7032be4725d2a3fc292ee27bf3ecc276316e19d4 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Thu, 27 Jan 2022 14:04:27 -0500 Subject: [PATCH] Don't re-adjust module positions based on patch bounding box when serializing RackWidget. --- src/app/RackWidget.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/app/RackWidget.cpp b/src/app/RackWidget.cpp index b2a05fc2..281411f8 100644 --- a/src/app/RackWidget.cpp +++ b/src/app/RackWidget.cpp @@ -273,12 +273,6 @@ static void RackWidget_updateExpanders(RackWidget* that) { } void RackWidget::mergeJson(json_t* rootJ) { - // Get module offset so modules are aligned to (0, 0) when the patch is loaded. - math::Vec moduleOffset = internal->moduleContainer->getChildrenBoundingBox().pos; - if (!moduleOffset.isFinite()) { - moduleOffset = RACK_OFFSET; - } - // modules json_t* modulesJ = json_object_get(rootJ, "modules"); if (!modulesJ) @@ -299,7 +293,7 @@ void RackWidget::mergeJson(json_t* rootJ) { } // pos - math::Vec pos = mw->box.pos.minus(moduleOffset); + math::Vec pos = mw->box.pos.minus(RACK_OFFSET); pos = pos.div(RACK_GRID_SIZE).round(); json_t* posJ = json_pack("[i, i]", (int) pos.x, (int) pos.y); json_object_set_new(moduleJ, "pos", posJ);