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

Method onChange

src/app/SvgSwitch.cpp:69–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67
68
69void SvgSwitch::onChange(const ChangeEvent& e) {
70 if (!latch) {
71 engine::ParamQuantity* pq = getParamQuantity();
72 if (!frames.empty() && pq) {
73 int index = (int) std::round(pq->getValue() - pq->getMinValue());
74 index = math::clamp(index, 0, (int) frames.size() - 1);
75 sw->setSvg(frames[index]);
76 fb->setDirty();
77 }
78 }
79 ParamWidget::onChange(e);
80}
81
82
83} // namespace app

Callers

nothing calls this directly

Calls 8

roundFunction · 0.85
setDirtyMethod · 0.80
clampFunction · 0.50
emptyMethod · 0.45
getValueMethod · 0.45
getMinValueMethod · 0.45
sizeMethod · 0.45
setSvgMethod · 0.45

Tested by

no test coverage detected