diff --git a/Makefile b/Makefile index 5888718f..79141167 100644 --- a/Makefile +++ b/Makefile @@ -7,9 +7,7 @@ FLAGS += -Idep/include -Idep/lib/libzip/include include arch.mk -STRIP ?= strip -SED := perl -p -i -e -# SED := sed -i +SED := perl -pi -e # Sources and build flags diff --git a/compile.mk b/compile.mk index 879d66e6..d21fe104 100644 --- a/compile.mk +++ b/compile.mk @@ -5,6 +5,7 @@ endif include $(RACK_DIR)/arch.mk OBJCOPY ?= objcopy +STRIP ?= strip # Generate dependency files alongside the object files FLAGS += -MMD -MP diff --git a/include/app/ParamWidget.hpp b/include/app/ParamWidget.hpp index 9e360cd2..90c784cc 100644 --- a/include/app/ParamWidget.hpp +++ b/include/app/ParamWidget.hpp @@ -23,7 +23,6 @@ struct ParamWidget : OpaqueWidget { /** For legacy patch loading */ void fromJson(json_t *rootJ); - void createParamField(); void createContextMenu(); void resetAction(); }; diff --git a/include/math.hpp b/include/math.hpp index fc2515df..dd6cc96f 100644 --- a/include/math.hpp +++ b/include/math.hpp @@ -109,7 +109,6 @@ inline float sgn(float x) { } /** Converts -0.f to 0.f. Leaves all other values unchanged. */ -__attribute__((optimize("signed-zeros"))) inline float normalizeZero(float x) { return x + 0.f; } diff --git a/plugin.mk b/plugin.mk index 9d024fae..6e1b4389 100644 --- a/plugin.mk +++ b/plugin.mk @@ -5,8 +5,6 @@ endif SLUG := $(shell jq ".slug" plugin.json) VERSION := $(shell jq ".version" plugin.json) -STRIP ?= strip - DISTRIBUTABLES += plugin.json FLAGS += -fPIC diff --git a/src/app/Knob.cpp b/src/app/Knob.cpp index 47c41563..8e70c25c 100644 --- a/src/app/Knob.cpp +++ b/src/app/Knob.cpp @@ -66,9 +66,14 @@ void Knob::onDragMove(const event::DragMove &e) { } float delta = KNOB_SENSITIVITY * -e.mouseDelta.y * speed * range; - // Drag slower if shift is held - if ((app()->window->getMods() & WINDOW_MOD_MASK) == GLFW_MOD_SHIFT) + // Drag slower if mod is held + if ((app()->window->getMods() & WINDOW_MOD_MASK) == WINDOW_MOD_CTRL) { delta /= 16.f; + } + // Drag even slower if mod+shift is held + if ((app()->window->getMods() & WINDOW_MOD_MASK) == (WINDOW_MOD_CTRL | GLFW_MOD_SHIFT)) { + delta /= 256.f; + } if (snap) { snapValue += delta; diff --git a/src/app/ParamWidget.cpp b/src/app/ParamWidget.cpp index d046975e..6cb6ab52 100644 --- a/src/app/ParamWidget.cpp +++ b/src/app/ParamWidget.cpp @@ -51,12 +51,6 @@ struct ParamField : TextField { e.consume(this); } - if (e.action == GLFW_PRESS && e.key == GLFW_KEY_ESCAPE) { - MenuOverlay *overlay = getAncestorOfType(); - overlay->requestedDelete = true; - e.consume(this); - } - if (!e.getConsumed()) TextField::onSelectKey(e); } @@ -103,18 +97,6 @@ struct ParamResetItem : MenuItem { }; -struct ParamFieldItem : MenuItem { - ParamWidget *paramWidget; - ParamFieldItem() { - text = "Enter value"; - rightText = WINDOW_MOD_ALT_NAME "+Click"; - } - void onAction(const event::Action &e) override { - paramWidget->createParamField(); - } -}; - - struct ParamFineItem : MenuItem { ParamFineItem() { text = "Fine adjust"; @@ -166,20 +148,14 @@ void ParamWidget::onButton(const event::Button &e) { e.consume(this); } - // Mod-click to reset - if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_LEFT && (e.mods & WINDOW_MOD_MASK) == WINDOW_MOD_CTRL) { + // Shift-click to reset + if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_LEFT && (e.mods & WINDOW_MOD_MASK) == GLFW_MOD_SHIFT) { resetAction(); // HACK so that dragging won't occur e.consume(NULL); return; } - // Shift-click to open value entry - if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_LEFT && (e.mods & WINDOW_MOD_MASK) == GLFW_MOD_ALT) { - createParamField(); - e.consume(this); - } - if (!e.getConsumed()) OpaqueWidget::onButton(e); } @@ -209,18 +185,6 @@ void ParamWidget::fromJson(json_t *rootJ) { } } -void ParamWidget::createParamField() { - // Create ParamField - MenuOverlay *overlay = new MenuOverlay; - app()->scene->addChild(overlay); - - ParamField *paramField = new ParamField; - paramField->box.size.x = 100; - paramField->box.pos = getAbsoluteOffset(box.size).round(); - paramField->setParamWidget(this); - overlay->addChild(paramField); -} - void ParamWidget::createContextMenu() { Menu *menu = createMenu(); @@ -228,16 +192,17 @@ void ParamWidget::createContextMenu() { paramLabel->paramWidget = this; menu->addChild(paramLabel); + ParamField *paramField = new ParamField; + paramField->box.size.x = 100; + paramField->setParamWidget(this); + menu->addChild(paramField); + ParamResetItem *resetItem = new ParamResetItem; resetItem->paramWidget = this; menu->addChild(resetItem); - ParamFieldItem *fieldItem = new ParamFieldItem; - fieldItem->paramWidget = this; - menu->addChild(fieldItem); - - // ParamFineItem *fineItem = new ParamFineItem; - // menu->addChild(fineItem); + ParamFineItem *fineItem = new ParamFineItem; + menu->addChild(fineItem); } void ParamWidget::resetAction() { diff --git a/src/widgets/FramebufferWidget.cpp b/src/widgets/FramebufferWidget.cpp index ea840b16..abfe8ef6 100644 --- a/src/widgets/FramebufferWidget.cpp +++ b/src/widgets/FramebufferWidget.cpp @@ -15,9 +15,12 @@ FramebufferWidget::~FramebufferWidget() { } void FramebufferWidget::draw(NVGcontext *vg) { - // Bypass framebuffer rendering entirely - // Widget::draw(vg); - // return; + // Bypass framebuffer rendering if we're already drawing in a framebuffer + // In other words, disallow nested framebuffers. They look bad. + if (vg == app()->window->fbVg) { + Widget::draw(vg); + return; + } // Get world transform float xform[6];