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

Method draw

src/ui/Button.cpp:14–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12
13
14void Button::draw(const DrawArgs& args) {
15 BNDwidgetState state = BND_DEFAULT;
16 if (APP->event->getHoveredWidget() == this)
17 state = BND_HOVER;
18 if (APP->event->getDraggedWidget() == this)
19 state = BND_ACTIVE;
20
21 std::string text = this->text;
22 if (text.empty() && quantity)
23 text = quantity->getLabel();
24 bndToolButton(args.vg, 0.0, 0.0, box.size.x, box.size.y, BND_CORNER_NONE, state, -1, text.c_str());
25}
26
27
28void Button::onDragStart(const DragStartEvent& e) {

Callers

nothing calls this directly

Calls 4

getHoveredWidgetMethod · 0.80
getDraggedWidgetMethod · 0.80
emptyMethod · 0.45
getLabelMethod · 0.45

Tested by

no test coverage detected