From af65f7b8e7ba2fa07751f7aeef9b03aefd11fcba Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Fri, 3 Apr 2020 03:43:49 -0400 Subject: [PATCH] Don't serialize module ID in module presets. --- src/app/ModuleWidget.cpp | 2 ++ src/app/RackScrollWidget.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/ModuleWidget.cpp b/src/app/ModuleWidget.cpp index 7da17c6f..46ea56c1 100644 --- a/src/app/ModuleWidget.cpp +++ b/src/app/ModuleWidget.cpp @@ -552,6 +552,8 @@ PortWidget* ModuleWidget::getOutput(int portId) { json_t* ModuleWidget::toJson() { json_t* moduleJ = APP->engine->moduleToJson(module); + // When serializing ModuleWidget, don't include the ID. This ID is only meaningful when serializing the entire rack. + json_object_del(moduleJ, "id"); return moduleJ; } diff --git a/src/app/RackScrollWidget.cpp b/src/app/RackScrollWidget.cpp index 1e88dfd2..33c9166c 100644 --- a/src/app/RackScrollWidget.cpp +++ b/src/app/RackScrollWidget.cpp @@ -102,9 +102,9 @@ void RackScrollWidget::onHoverKey(const event::HoverKey& e) { float arrowSpeed = 30.0; if ((e.mods & RACK_MOD_MASK) == (RACK_MOD_CTRL | GLFW_MOD_SHIFT)) arrowSpeed /= 16.0; - else if ((e.mods & RACK_MOD_MASK) == RACK_MOD_CTRL) + if ((e.mods & RACK_MOD_MASK) == RACK_MOD_CTRL) arrowSpeed *= 4.0; - else if ((e.mods & RACK_MOD_MASK) == GLFW_MOD_SHIFT) + if ((e.mods & RACK_MOD_MASK) == GLFW_MOD_SHIFT) arrowSpeed /= 4.0; if (e.action == RACK_HELD) {