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.

48 lines
928B

  1. #include "scene.hpp"
  2. #include "gui.hpp"
  3. namespace rack {
  4. RackScene::RackScene() {
  5. scrollWidget = new ScrollWidget();
  6. {
  7. assert(!gRackWidget);
  8. gRackWidget = new RackWidget();
  9. scrollWidget->container->addChild(gRackWidget);
  10. }
  11. addChild(scrollWidget);
  12. toolbar = new Toolbar();
  13. addChild(toolbar);
  14. scrollWidget->box.pos.y = toolbar->box.size.y;
  15. }
  16. void RackScene::step() {
  17. toolbar->box.size.x = box.size.x;
  18. scrollWidget->box.size = box.size.minus(scrollWidget->box.pos);
  19. Scene::step();
  20. }
  21. void RackScene::draw(NVGcontext *vg) {
  22. Scene::draw(vg);
  23. // // Draw custom stuff here
  24. // static std::shared_ptr<SVG> svg;
  25. // if (!svg)
  26. // svg = SVG::load("res/ComponentLibrary/CL1362.svg");
  27. // for (float y = 0.0; y < 1000.0; y += 200.0)
  28. // for (float x = 0.0; x < 1000.0; x += 200.0) {
  29. // nvgSave(vg);
  30. // nvgTranslate(vg, x, y);
  31. // drawSVG(vg, svg->handle);
  32. // nvgRestore(vg);
  33. // }
  34. }
  35. } // namespace rack