| 315 | } |
| 316 | |
| 317 | void 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 | |
| 335 | void ModuleWidget::onHover(const HoverEvent& e) { |
| 336 | if (APP->scene->rack->isSelected(this)) { |
nothing calls this directly
no test coverage detected