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.

24 lines
529B

  1. #include <ui/MenuLabel.hpp>
  2. #include <context.hpp>
  3. namespace rack {
  4. namespace ui {
  5. void MenuLabel::draw(const DrawArgs& args) {
  6. bndMenuLabel(args.vg, 0.0, 0.0, box.size.x, box.size.y, -1, text.c_str());
  7. }
  8. void MenuLabel::step() {
  9. // Add 10 more pixels because Retina measurements are sometimes too small
  10. const float rightPadding = 10.0;
  11. // HACK use APP->window->vg from the window.
  12. box.size.x = bndLabelWidth(APP->window->vg, -1, text.c_str()) + rightPadding;
  13. Widget::step();
  14. }
  15. } // namespace ui
  16. } // namespace rack