diff --git a/src/Core/Blank.cpp b/src/Core/Blank.cpp index f143548e..4b8feda2 100644 --- a/src/Core/Blank.cpp +++ b/src/Core/Blank.cpp @@ -4,6 +4,28 @@ using namespace rack; +struct BlankPanel : virtual Widget { + Widget *panelBorder; + + BlankPanel() { + panelBorder = new PanelBorder; + addChild(panelBorder); + } + + void step() override { + panelBorder->box.size = box.size; + } + + void draw(NVGcontext *vg) override { + nvgBeginPath(vg); + nvgRect(vg, 0.0, 0.0, box.size.x, box.size.y); + nvgFillColor(vg, nvgRGB(0xe6, 0xe6, 0xe6)); + nvgFill(vg); + Widget::draw(vg); + } +}; + + struct ModuleResizeHandle : virtual Widget { bool right = false; float dragX; @@ -58,7 +80,6 @@ struct ModuleResizeHandle : virtual Widget { struct BlankWidget : ModuleWidget { - // Panel *panel; Widget *topRightScrew; Widget *bottomRightScrew; Widget *rightHandle; @@ -66,11 +87,8 @@ struct BlankWidget : ModuleWidget { BlankWidget(Module *module) : ModuleWidget(module) { box.size = Vec(RACK_GRID_WIDTH * 10, RACK_GRID_HEIGHT); - // { - // panel = new LightPanel; - // panel->box.size = box.size; - // addChild(panel); - // } + panel = new BlankPanel; + addChild(panel); ModuleResizeHandle *leftHandle = new ModuleResizeHandle; ModuleResizeHandle *rightHandle = new ModuleResizeHandle; @@ -88,7 +106,7 @@ struct BlankWidget : ModuleWidget { } void step() override { - // panel->box.size = box.size; + panel->box.size = box.size; topRightScrew->box.pos.x = box.size.x - 30; bottomRightScrew->box.pos.x = box.size.x - 30; if (box.size.x < RACK_GRID_WIDTH * 6) { diff --git a/src/app/ParamQuantity.cpp b/src/app/ParamQuantity.cpp index 51d6dd3d..9decd864 100644 --- a/src/app/ParamQuantity.cpp +++ b/src/app/ParamQuantity.cpp @@ -24,25 +24,25 @@ void ParamQuantity::setValue(float value) { float ParamQuantity::getValue() { if (!module) - return Quantity::getValue(); + return 0.f; return getParam()->value; } float ParamQuantity::getMinValue() { if (!module) - return Quantity::getMinValue(); + return -1.f; return getParam()->minValue; } float ParamQuantity::getMaxValue() { if (!module) - return Quantity::getMaxValue(); + return 1.f; return getParam()->maxValue; } float ParamQuantity::getDefaultValue() { if (!module) - return Quantity::getDefaultValue(); + return 0.f; return getParam()->defaultValue; }