diff --git a/include/app.hpp b/include/app.hpp
index 60e527b9..968036dd 100644
--- a/include/app.hpp
+++ b/include/app.hpp
@@ -217,7 +217,9 @@ struct Component : OpaqueWidget {
};
struct CircularShadow : TransparentWidget {
- float blur = 0.0;
+ float blurRadius;
+ float opacity;
+ CircularShadow();
void draw(NVGcontext *vg) override;
};
@@ -276,6 +278,7 @@ struct SVGKnob : Knob, FramebufferWidget {
float minAngle, maxAngle;
TransformWidget *tw;
SVGWidget *sw;
+ CircularShadow *shadow;
SVGKnob();
void setSVG(std::shared_ptr
diff --git a/res/ComponentLibrary/BefacoTinyKnob.svg b/res/ComponentLibrary/BefacoTinyKnob.svg
index 3d38e4c8..b3db71a3 100644
--- a/res/ComponentLibrary/BefacoTinyKnob.svg
+++ b/res/ComponentLibrary/BefacoTinyKnob.svg
@@ -9,376 +9,15 @@
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="8.6999998mm"
- height="8.7000618mm"
- viewBox="0 0 8.7000002 8.7000631"
+ width="9.0000019mm"
+ height="9.0000801mm"
+ viewBox="0 0 9.0000016 9.00008"
version="1.1"
- id="svg15246"
- sodipodi:docname="BefacoTinyKnob.svg"
- inkscape:version="0.92.2 5c3e80d, 2017-08-06">
+ id="svg113936"
+ inkscape:version="0.92.2 5c3e80d, 2017-08-06"
+ sodipodi:docname="BefacoTinyKnob.svg">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ id="defs113930" />
+ inkscape:window-maximized="0" />
+ id="metadata113933">
@@ -418,26 +56,31 @@
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
- transform="translate(-44.329061,-94.497224)">
+ transform="translate(-111.86932,-85.795053)">
+
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.28209424"
+ d="m 120.02026,91.143448 c -0.46281,2.022043 -2.47716,3.285957 -4.49919,2.823148 -2.02205,-0.462813 -3.28598,-2.47714 -2.82314,-4.499182 0.46281,-2.020944 2.47713,-3.285958 4.49918,-2.82315 2.02093,0.462812 3.28594,2.477141 2.82315,4.499184"
+ id="path109732" />
+ style="fill:none;stroke:#7f7878;stroke-width:0.11481237;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1"
+ d="m 120.02026,91.143463 c -0.46281,2.022042 -2.47715,3.285956 -4.49919,2.823145 -2.02204,-0.462811 -3.28595,-2.47714 -2.82314,-4.499183 0.46281,-2.020941 2.47714,-3.285957 4.49918,-2.823145 2.02094,0.46281 3.28596,2.47714 2.82315,4.499183 z m 0,0"
+ id="path109734" />
+ style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.28209424"
+ d="m 116.20648,88.009558 c -0.11239,-0.07603 -0.14328,-0.229201 -0.0672,-0.342701 0.0761,-0.113495 0.23029,-0.143251 0.34379,-0.06722 0.11356,0.07603 0.14325,0.229201 0.0672,0.342701 -0.076,0.113495 -0.23031,0.14325 -0.34379,0.06722"
+ id="path109736" />
+ style="fill:none;stroke:#000000;stroke-width:0.46912277;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ d="m 116.20647,88.009571 c -0.11239,-0.07603 -0.14326,-0.229202 -0.0672,-0.3427 0.076,-0.113495 0.23032,-0.14325 0.34381,-0.06722 0.11356,0.07602 0.14325,0.229201 0.0672,0.3427 -0.076,0.113495 -0.2303,0.143251 -0.3438,0.06722 z m 0,0"
+ id="path109738" />
diff --git a/res/ComponentLibrary/RoundBlack.svg b/res/ComponentLibrary/RoundBlack.svg
deleted file mode 100644
index 92969944..00000000
--- a/res/ComponentLibrary/RoundBlack.svg
+++ /dev/null
@@ -1,123 +0,0 @@
-
-
-
-
diff --git a/res/ComponentLibrary/RoundBlackKnob.svg b/res/ComponentLibrary/RoundBlackKnob.svg
new file mode 100644
index 00000000..0fa91ad9
--- /dev/null
+++ b/res/ComponentLibrary/RoundBlackKnob.svg
@@ -0,0 +1,71 @@
+
+
+
+
diff --git a/res/ComponentLibrary/RoundHugeBlackKnob.svg b/res/ComponentLibrary/RoundHugeBlackKnob.svg
new file mode 100644
index 00000000..cc3c2a7f
--- /dev/null
+++ b/res/ComponentLibrary/RoundHugeBlackKnob.svg
@@ -0,0 +1,71 @@
+
+
+
+
diff --git a/res/ComponentLibrary/RoundLargeBlackKnob.svg b/res/ComponentLibrary/RoundLargeBlackKnob.svg
new file mode 100644
index 00000000..82e4ae7a
--- /dev/null
+++ b/res/ComponentLibrary/RoundLargeBlackKnob.svg
@@ -0,0 +1,71 @@
+
+
+
+
diff --git a/res/ComponentLibrary/RoundSmallBlackKnob.svg b/res/ComponentLibrary/RoundSmallBlackKnob.svg
new file mode 100644
index 00000000..609d3a87
--- /dev/null
+++ b/res/ComponentLibrary/RoundSmallBlackKnob.svg
@@ -0,0 +1,71 @@
+
+
+
+
diff --git a/res/ComponentLibrary/Trimpot.svg b/res/ComponentLibrary/Trimpot.svg
index 6191a6d0..f8ff0922 100644
--- a/res/ComponentLibrary/Trimpot.svg
+++ b/res/ComponentLibrary/Trimpot.svg
@@ -9,376 +9,15 @@
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="6.2990241mm"
- height="6.3003879mm"
- viewBox="0 0 6.2990242 6.3003887"
+ width="6.2990298mm"
+ height="6.3003922mm"
+ viewBox="0 0 6.2990294 6.3003921"
version="1.1"
- id="svg15246"
- sodipodi:docname="Trimpot.svg"
- inkscape:version="0.92.2 5c3e80d, 2017-08-06">
+ id="svg111794"
+ inkscape:version="0.92.2 5c3e80d, 2017-08-06"
+ sodipodi:docname="Trimpot.svg">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ id="defs111788" />
+ fit-margin-bottom="0"
+ inkscape:window-width="2560"
+ inkscape:window-height="1422"
+ inkscape:window-x="0"
+ inkscape:window-y="18"
+ inkscape:window-maximized="0" />
+ id="metadata111791">
@@ -418,16 +56,16 @@
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
- transform="translate(-46.318588,-97.647662)">
+ transform="translate(-183.93691,-77.348595)">
+ style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277775"
+ d="m 183.93691,80.498791 c 0,1.740461 1.40974,3.150196 3.1502,3.150196 1.73909,0 3.14883,-1.409735 3.14883,-3.150196 0,-1.739085 -1.40974,-3.150196 -3.14883,-3.150196 -1.74046,0 -3.1502,1.411111 -3.1502,3.150196"
+ id="path108214" />
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.35277775"
+ d="m 187.29109,77.359619 c -0.0675,-0.0055 -0.13508,-0.01101 -0.20398,-0.01101 -0.0689,0 -0.13779,0.0055 -0.20531,0.01101 v 3.139172 h 0.40929 z m 0,0"
+ id="path108216" />
diff --git a/src/app/CircularShadow.cpp b/src/app/CircularShadow.cpp
index 3d3ec3fe..2e00f08d 100644
--- a/src/app/CircularShadow.cpp
+++ b/src/app/CircularShadow.cpp
@@ -4,15 +4,24 @@
namespace rack {
+CircularShadow::CircularShadow() {
+ blurRadius = 0;
+ opacity = 0.15;
+ // blurRadius = 0;
+ // opacity = 0.15;
+}
+
void CircularShadow::draw(NVGcontext *vg) {
+ if (opacity < 0.0)
+ return;
+
nvgBeginPath(vg);
- nvgRect(vg, -blur, -blur, box.size.x + 2*blur, box.size.y + 2*blur);
- nvgFillColor(vg, nvgRGBAf(0.0, 0.0, 0.0, 0.25));
- Vec c = box.size.div(2.0);
- float radius = c.x;
- NVGcolor icol = nvgRGBAf(0.0, 0.0, 0.0, 0.25);
+ nvgRect(vg, -blurRadius, -blurRadius, box.size.x + 2*blurRadius, box.size.y + 2*blurRadius);
+ Vec center = box.size.div(2.0);
+ float radius = center.x;
+ NVGcolor icol = nvgRGBAf(0.0, 0.0, 0.0, opacity);
NVGcolor ocol = nvgRGBAf(0.0, 0.0, 0.0, 0.0);
- NVGpaint paint = nvgRadialGradient(vg, c.x, c.y, radius - blur/2, radius + blur/2, icol, ocol);
+ NVGpaint paint = nvgRadialGradient(vg, center.x, center.y, radius - blurRadius, radius, icol, ocol);
nvgFillPaint(vg, paint);
nvgFill(vg);
}
diff --git a/src/app/SVGKnob.cpp b/src/app/SVGKnob.cpp
index 0d0f56f9..5a53b943 100644
--- a/src/app/SVGKnob.cpp
+++ b/src/app/SVGKnob.cpp
@@ -5,6 +5,9 @@ namespace rack {
SVGKnob::SVGKnob() {
+ shadow = new CircularShadow();
+ addChild(shadow);
+
tw = new TransformWidget();
addChild(tw);
@@ -13,22 +16,21 @@ SVGKnob::SVGKnob() {
}
void SVGKnob::setSVG(std::shared_ptr