MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / drawLayer

Method drawLayer

src/override/ModuleWidget.cpp:317–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315}
316
317void ModuleWidget::drawLayer(const DrawArgs& args, int layer) {
318 if (layer == -1) {
319 nvgBeginPath(args.vg);
320 float r = 20; // Blur radius
321 float c = 20; // Corner radius
322 math::Rect shadowBox = box.zeroPos().grow(math::Vec(10, -30));
323 math::Rect shadowOutsideBox = shadowBox.grow(math::Vec(r, r));
324 nvgRect(args.vg, RECT_ARGS(shadowOutsideBox));
325 NVGcolor shadowColor = nvgRGBAf(0, 0, 0, 0.2);
326 NVGcolor transparentColor = nvgRGBAf(0, 0, 0, 0);
327 nvgFillPaint(args.vg, nvgBoxGradient(args.vg, RECT_ARGS(shadowBox), c, r, shadowColor, transparentColor));
328 nvgFill(args.vg);
329 }
330 else {
331 Widget::drawLayer(args, layer);
332 }
333}
334
335void ModuleWidget::onHover(const HoverEvent& e) {
336 if (APP->scene->rack->isSelected(this)) {

Callers

nothing calls this directly

Calls 8

nvgBeginPathFunction · 0.85
VecClass · 0.85
nvgRectFunction · 0.85
nvgRGBAfFunction · 0.85
nvgFillPaintFunction · 0.85
nvgFillFunction · 0.85
growMethod · 0.80
zeroPosMethod · 0.80

Tested by

no test coverage detected