You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
449B

  1. #include "widgets.hpp"
  2. #include "gui.hpp"
  3. namespace rack {
  4. void MenuLabel::draw(NVGcontext *vg) {
  5. bndMenuLabel(vg, 0.0, 0.0, box.size.x, box.size.y, -1, text.c_str());
  6. }
  7. void MenuLabel::step() {
  8. // Add 10 more pixels because Retina measurements are sometimes too small
  9. const float rightPadding = 10.0;
  10. // HACK use gVg from the gui.
  11. box.size.x = bndLabelWidth(gVg, -1, text.c_str()) + rightPadding;
  12. Widget::step();
  13. }
  14. } // namespace rack