|
|
@@ -69,15 +69,16 @@ void LightWidget::drawHalo(const DrawArgs& args) { |
|
|
|
if (color.r == 0.f && color.g == 0.f && color.b == 0.f) |
|
|
|
return; |
|
|
|
|
|
|
|
math::Vec c = box.size.div(2); |
|
|
|
float radius = std::min(box.size.x, box.size.y) / 2.0; |
|
|
|
float oradius = radius + std::min(radius * 4.f, 15.f); |
|
|
|
|
|
|
|
nvgBeginPath(args.vg); |
|
|
|
nvgRect(args.vg, radius - oradius, radius - oradius, 2 * oradius, 2 * oradius); |
|
|
|
nvgRect(args.vg, c.x - oradius, c.y - oradius, 2 * oradius, 2 * oradius); |
|
|
|
|
|
|
|
NVGcolor icol = color::mult(color, halo); |
|
|
|
NVGcolor ocol = nvgRGBA(0, 0, 0, 0); |
|
|
|
NVGpaint paint = nvgRadialGradient(args.vg, radius, radius, radius, oradius, icol, ocol); |
|
|
|
NVGpaint paint = nvgRadialGradient(args.vg, c.x, c.y, radius, oradius, icol, ocol); |
|
|
|
nvgFillPaint(args.vg, paint); |
|
|
|
nvgFill(args.vg); |
|
|
|
} |
|
|
|