cycle through the values (with reset) on click only (not drag)
| 289 | |
| 290 | // cycle through the values (with reset) on click only (not drag) |
| 291 | void onAction(const ActionEvent& e) override { |
| 292 | ParamQuantity* paramQuantity = getParamQuantity(); |
| 293 | float range = paramQuantity->maxValue - paramQuantity->minValue; |
| 294 | float newValue = paramQuantity->getValue() + 1.f; |
| 295 | if (newValue > paramQuantity->maxValue) { |
| 296 | newValue -= range + 1.f; |
| 297 | } |
| 298 | paramQuantity->setValue(newValue); |
| 299 | } |
| 300 | }; |
| 301 | |
| 302 |