Browse Source

Draw layer 1 (lights) of ModuleWidgets in Browser and Window::screenshotModules().

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
8131083655
2 changed files with 25 additions and 2 deletions
  1. +14
    -1
      src/app/Browser.cpp
  2. +11
    -1
      src/window/Window.cpp

+ 14
- 1
src/app/Browser.cpp View File

@@ -130,6 +130,14 @@ struct BrowserOverlay : ui::MenuOverlay {
};


struct ModuleWidgetContainer : widget::Widget {
void draw(const DrawArgs& args) override {
Widget::draw(args);
Widget::drawLayer(args, 1);
}
};


struct ModelBox : widget::OpaqueWidget {
plugin::Model* model;
ui::Tooltip* tooltip = NULL;
@@ -137,6 +145,7 @@ struct ModelBox : widget::OpaqueWidget {
widget::Widget* previewWidget = NULL;
widget::ZoomWidget* zoomWidget = NULL;
widget::FramebufferWidget* fb = NULL;
ModuleWidgetContainer* mwc = NULL;
ModuleWidget* moduleWidget = NULL;

ModelBox() {
@@ -181,8 +190,12 @@ struct ModelBox : widget::OpaqueWidget {
}
zoomWidget->addChild(fb);

mwc = new ModuleWidgetContainer;
fb->addChild(mwc);

moduleWidget = model->createModuleWidget(NULL);
fb->addChild(moduleWidget);
mwc->addChild(moduleWidget);
mwc->box.size = moduleWidget->box.size;

updateZoom();
}


+ 11
- 1
src/window/Window.cpp View File

@@ -567,9 +567,19 @@ void Window::screenshotModules(const std::string& screenshotsDir, float zoom) {
widget::FramebufferWidget* fbw = new widget::FramebufferWidget;
fbw->oversample = 2;

struct ModuleWidgetContainer : widget::Widget {
void draw(const DrawArgs& args) override {
Widget::draw(args);
Widget::drawLayer(args, 1);
}
};
ModuleWidgetContainer* mwc = new ModuleWidgetContainer;
fbw->addChild(mwc);

app::ModuleWidget* mw = model->createModuleWidget(NULL);
fbw->addChild(mw);
mwc->box.size = mw->box.size;
fbw->box.size = mw->box.size;
mwc->addChild(mw);

// Step to allow the ModuleWidget state to set its default appearance.
fbw->step();


Loading…
Cancel
Save