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

Method draw

src/ui/ChoiceButton.cpp:9–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7
8
9void ChoiceButton::draw(const DrawArgs& args) {
10 BNDwidgetState state = BND_DEFAULT;
11 if (APP->event->getHoveredWidget() == this)
12 state = BND_HOVER;
13 if (APP->event->getDraggedWidget() == this)
14 state = BND_ACTIVE;
15
16 std::string text = this->text;
17 if (text.empty() && quantity)
18 text = quantity->getLabel();
19 bndChoiceButton(args.vg, 0.0, 0.0, box.size.x, box.size.y, BND_CORNER_NONE, state, -1, text.c_str());
20}
21
22
23} // namespace ui

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