BogaudioModules

BogaudioModules for VCV Rack
Log | Files | Refs | README | LICENSE

commit 1724e026c6bda0c3608a529cb2d198c8b8ec8c1f
parent 4d7ae910125332b58cab4f1e4a938f4d63dc5cdb
Author: Matt Demanett <matt@demanett.net>
Date:   Mon, 16 Dec 2019 21:36:47 -0500

Fix up drawing of indicator switches.

Diffstat:
Msrc/widgets.cpp | 40+++++++++++++++++-----------------------
1 file changed, 17 insertions(+), 23 deletions(-)

diff --git a/src/widgets.cpp b/src/widgets.cpp @@ -310,7 +310,7 @@ void InvertingIndicatorButton::IIBWidget::draw(const DrawArgs& args) { nvgFillColor(args.vg, nvgRGBA(0x33, 0x33, 0x33, 0xff)); nvgFill(args.vg); - r -= std::max(0.2f, 0.3f * s); + r -= std::max(0.2f, 0.6f * s); nvgBeginPath(args.vg); nvgCircle(args.vg, c, c, r); nvgFillColor(args.vg, nvgRGBA(0xee, 0xee, 0xee, 0xff)); @@ -319,39 +319,33 @@ void InvertingIndicatorButton::IIBWidget::draw(const DrawArgs& args) { nvgCircle(args.vg, c, c, r); nvgFillColor(args.vg, _color); nvgFill(args.vg); - - r -= 0.15f; - nvgBeginPath(args.vg); nvgCircle(args.vg, c, c, r); - nvgStrokeColor(args.vg, nvgRGBA(0x66, 0x66, 0x66, 0x7f)); - nvgStrokeWidth(args.vg, 0.3f * s); - nvgStroke(args.vg); + nvgFillColor(args.vg, nvgRGBA(0x66, 0x66, 0x66, 0x7f)); + nvgFill(args.vg); - float dr = std::max(0.2f, 0.3f * s); - r -= dr; + r -= std::max(0.2f, 0.6f * s); nvgBeginPath(args.vg); nvgCircle(args.vg, c, c, r); - nvgStrokeColor(args.vg, nvgRGBA(0x77, 0x77, 0x77, 0x7f)); - nvgStrokeWidth(args.vg, dr); - nvgStroke(args.vg); - - r -= dr; + nvgFillColor(args.vg, nvgRGBA(0xee, 0xee, 0xee, 0xff)); + nvgFill(args.vg); nvgBeginPath(args.vg); nvgCircle(args.vg, c, c, r); - nvgStrokeColor(args.vg, nvgRGBA(0x88, 0x88, 0x88, 0x7f)); - nvgStrokeWidth(args.vg, dr); - nvgStroke(args.vg); + nvgFillColor(args.vg, _color); + nvgFill(args.vg); + nvgCircle(args.vg, c, c, r); + nvgFillColor(args.vg, nvgRGBA(0x88, 0x88, 0x88, 0x7f)); + nvgFill(args.vg); - r -= dr; + r -= std::max(0.2f, 0.6f * s); nvgBeginPath(args.vg); nvgCircle(args.vg, c, c, r); - nvgStrokeColor(args.vg, nvgRGBA(0x99, 0x99, 0x99, 0x7f)); - nvgStrokeWidth(args.vg, dr); - nvgStroke(args.vg); - - r -= 0.15f; + nvgFillColor(args.vg, nvgRGBA(0xee, 0xee, 0xee, 0xff)); + nvgFill(args.vg); nvgBeginPath(args.vg); nvgCircle(args.vg, c, c, r); + nvgFillColor(args.vg, _color); + nvgFill(args.vg); + nvgCircle(args.vg, c, c, r); nvgFillColor(args.vg, nvgRGBA(0xaa, 0xaa, 0xaa, 0x7f)); nvgFill(args.vg);