diff --git a/.gitignore b/.gitignore index 10cd38c4..fc44a0b5 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,4 @@ resources/nanogui-entypo compile_commands.json .clangd +.cache diff --git a/src/canvas.cpp b/src/canvas.cpp index 7e4b950b..a4f46056 100644 --- a/src/canvas.cpp +++ b/src/canvas.cpp @@ -133,8 +133,6 @@ void Canvas::draw(NVGcontext *ctx) { float pixel_ratio = scr->pixel_ratio(); - Widget::draw(ctx); - scr->nvg_flush(); Vector2i fbsize = m_size; @@ -186,6 +184,8 @@ void Canvas::draw(NVGcontext *ctx) { #endif rp->blit_to(Vector2i(0, 0), fbsize, scr, offset); } + + Widget::draw(ctx); } NAMESPACE_END(nanogui) diff --git a/src/example1.cpp b/src/example1.cpp index 3f34f464..d889848d 100644 --- a/src/example1.cpp +++ b/src/example1.cpp @@ -209,6 +209,9 @@ class ExampleApplication : public Screen { } ); + // Create an overlay label for the image view + new Label(image_view, "This is an overlay"); + new Label(window, "File dialog", "sans-bold"); tools = new Widget(window); tools->set_layout(new BoxLayout(Orientation::Horizontal,