diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
@@ -718,6 +718,8 @@ int main(int argc, char *argv[]) // Visual components Colormap cpColormap, rpColormap; + // cpColormap.setOrientation(Colormap::Vertical); + // rpColormap.setOrientation(Colormap::Vertical); Scatterplot cpPlot, rpPlot; VoronoiSplat splat; cpPlot.setSize(512, 512); @@ -1197,22 +1199,29 @@ int main(int argc, char *argv[]) } nk_end(&ctx); + struct nk_style *s = &ctx.style; + nk_style_push_color(&ctx, &s->window.background, nk_rgba(0, 0, 0, 0)); + nk_style_push_style_item(&ctx, &s->window.fixed_background, + nk_style_item_color(nk_rgba(0,0,0,0))); if (nk_begin(&ctx, "Scatterplot", nk_rect(20, 20, splat.width(), splat.height()), - NK_WINDOW_BORDER | NK_WINDOW_NO_SCROLLBAR)) { - struct nk_command_buffer *canvas = nk_window_get_canvas(&ctx); - struct nk_rect region{0.0f, 0.0f, - static_cast<float>(splat.width()), - static_cast<float>(splat.height())}; - + NK_WINDOW_NO_SCROLLBAR)) { // Render components to their textures splat.draw(); rpPlot.draw(); cpPlot.draw(); + nk_layout_space_begin(&ctx, NK_STATIC, splat.height(), 4); + struct nk_rect region = nk_layout_space_bounds(&ctx); + // Add white background rect and draw textures on top - nk_layout_space_begin(&ctx, NK_STATIC, region.h, 4); nk_layout_space_push(&ctx, region); + struct nk_command_buffer *canvas = nk_window_get_canvas(&ctx); nk_fill_rect(canvas, region, 0.0f, nk_rgba(255, 255, 255, 255)); + + // Rest uses custom region + region.x = region.y = 0.0f; + region.w = static_cast<float>(splat.width()); + region.h = static_cast<float>(splat.height()); nk_layout_space_push(&ctx, region); nk_image(&ctx, splat_img); nk_layout_space_push(&ctx, region); @@ -1222,6 +1231,8 @@ int main(int argc, char *argv[]) nk_layout_space_end(&ctx); } nk_end(&ctx); + nk_style_pop_color(&ctx); + nk_style_pop_style_item(&ctx); if (nk_begin(&ctx, "Colormap", nk_rect(20, 40 + splat.height(), splat.width(), 120), NK_WINDOW_BORDER | NK_WINDOW_TITLE | NK_WINDOW_NO_SCROLLBAR)) { |