MCPcopy Create free account
hub / github.com/VCVRack/Rack / drawBackground

Method drawBackground

include/componentlibrary.hpp:219–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217template <typename TBase>
218struct RectangleLight : TBase {
219 void drawBackground(const widget::Widget::DrawArgs& args) override {
220 // Derived from LightWidget::drawBackground()
221
222 nvgBeginPath(args.vg);
223 nvgRect(args.vg, 0, 0, this->box.size.x, this->box.size.y);
224
225 // Background
226 if (this->bgColor.a > 0.0) {
227 nvgFillColor(args.vg, this->bgColor);
228 nvgFill(args.vg);
229 }
230
231 // Border
232 if (this->borderColor.a > 0.0) {
233 nvgStrokeWidth(args.vg, 0.5);
234 nvgStrokeColor(args.vg, this->borderColor);
235 nvgStroke(args.vg);
236 }
237 }
238
239 void drawLight(const widget::Widget::DrawArgs& args) override {
240 // Derived from LightWidget::drawLight()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected