MCPcopy Create free account
hub / github.com/VCVRack/Rack / drawBackground

Method drawBackground

src/app/LightWidget.cpp:30–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28
29
30void LightWidget::drawBackground(const DrawArgs& args) {
31 float radius = std::min(box.size.x, box.size.y) / 2.0;
32 nvgBeginPath(args.vg);
33 nvgCircle(args.vg, radius, radius, radius);
34
35 // Background
36 if (bgColor.a > 0.0) {
37 nvgFillColor(args.vg, bgColor);
38 nvgFill(args.vg);
39 }
40
41 // Border
42 if (borderColor.a > 0.0) {
43 nvgStrokeWidth(args.vg, 0.5);
44 nvgStrokeColor(args.vg, borderColor);
45 nvgStroke(args.vg);
46 }
47}
48
49
50void LightWidget::drawLight(const DrawArgs& args) {

Callers

nothing calls this directly

Calls 1

minFunction · 0.85

Tested by

no test coverage detected