| 28 | |
| 29 | |
| 30 | void 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 | |
| 50 | void LightWidget::drawLight(const DrawArgs& args) { |