| 288 | } |
| 289 | |
| 290 | void ModuleWidget::drawLayer(const DrawArgs& args, int layer) { |
| 291 | if (layer == -1) { |
| 292 | nvgBeginPath(args.vg); |
| 293 | float r = 20; // Blur radius |
| 294 | float c = 20; // Corner radius |
| 295 | math::Rect shadowBox = box.zeroPos().grow(math::Vec(10, -30)); |
| 296 | math::Rect shadowOutsideBox = shadowBox.grow(math::Vec(r, r)); |
| 297 | nvgRect(args.vg, RECT_ARGS(shadowOutsideBox)); |
| 298 | NVGcolor shadowColor = nvgRGBAf(0, 0, 0, 0.2); |
| 299 | NVGcolor transparentColor = nvgRGBAf(0, 0, 0, 0); |
| 300 | nvgFillPaint(args.vg, nvgBoxGradient(args.vg, RECT_ARGS(shadowBox), c, r, shadowColor, transparentColor)); |
| 301 | nvgFill(args.vg); |
| 302 | } |
| 303 | else { |
| 304 | Widget::drawLayer(args, layer); |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | void ModuleWidget::onHover(const HoverEvent& e) { |
| 309 | if (APP->scene->rack->isSelected(this)) { |