From c89672c7f872fe8b1f7791c5bdbf2f4a0076ba2f Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Fri, 5 Nov 2021 14:21:34 -0400 Subject: [PATCH] Update VCA-1 slider appearance. --- res/VCA-1.svg | 87 +++++++++++++++++++++++++++------------------------ src/VCA-1.cpp | 18 +++++------ 2 files changed, 54 insertions(+), 51 deletions(-) diff --git a/res/VCA-1.svg b/res/VCA-1.svg index 41ceeed..f4fa644 100644 --- a/res/VCA-1.svg +++ b/res/VCA-1.svg @@ -1,21 +1,21 @@ + id="svg60" + sodipodi:docname="VCA-1.svg" + inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + id="metadata64"> @@ -34,21 +34,22 @@ guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" - inkscape:window-width="716" - inkscape:window-height="480" - id="namedview114" + inkscape:window-width="1600" + inkscape:window-height="882" + id="namedview62" showgrid="false" - inkscape:zoom="0.62105263" - inkscape:cx="22.5" - inkscape:cy="190" + inkscape:zoom="1.831032" + inkscape:cx="8.7382416" + inkscape:cy="155.10379" inkscape:window-x="0" - inkscape:window-y="0" - inkscape:window-maximized="0" - inkscape:current-layer="svg112" /> + inkscape:window-y="18" + inkscape:window-maximized="1" + inkscape:current-layer="eecf84db-9978-4a59-8668-617340dd9f58" + inkscape:pagecheckerboard="0" /> @@ -173,42 +174,46 @@ diff --git a/src/VCA-1.cpp b/src/VCA-1.cpp index 308b429..28b0884 100644 --- a/src/VCA-1.cpp +++ b/src/VCA-1.cpp @@ -71,8 +71,8 @@ struct VCA_1VUKnob : SliderKnob { VCA_1* module = dynamic_cast(this->module); - const Vec margin = Vec(3, 3); - Rect r = box.zeroPos().grow(margin.neg()); + Rect r = box.zeroPos(); + NVGcolor bgColor = nvgRGB(0x12, 0x12, 0x12); int channels = module ? module->lastChannels : 1; engine::ParamQuantity* pq = getParamQuantity(); @@ -86,7 +86,7 @@ struct VCA_1VUKnob : SliderKnob { r.pos.y + r.size.y * (1 - value), r.size.x, r.size.y * value); - nvgFillColor(args.vg, color::mult(color::WHITE, 0.33)); + nvgFillColor(args.vg, color::mult(color::WHITE, 0.25)); nvgFill(args.vg); } @@ -115,18 +115,13 @@ struct VCA_1VUKnob : SliderKnob { r.size.x + 2.0, 1.0); } - nvgFillColor(args.vg, color::BLACK); + nvgFillColor(args.vg, bgColor); nvgFill(args.vg); } }; struct VCA_1Display : LedDisplay { - void setModule(VCA_1* module) { - VCA_1VUKnob* knob = createParam(mm2px(Vec(0.0, 0.0)), module, VCA_1::LEVEL_PARAM); - knob->box.size = mm2px(Vec(15.263, 55.88)); - addChild(knob); - } }; @@ -147,8 +142,11 @@ struct VCA_1Widget : ModuleWidget { VCA_1Display* display = createWidget(mm2px(Vec(0.0, 13.039))); display->box.size = mm2px(Vec(15.263, 55.88)); - display->setModule(module); addChild(display); + + VCA_1VUKnob* knob = createParam(mm2px(Vec(2.253, 15.931)), module, VCA_1::LEVEL_PARAM); + knob->box.size = mm2px(Vec(10.734, 50.253)); + addChild(knob); } void appendContextMenu(Menu* menu) override {