From 1baa3336633bd4b596179310c4e0306e94155e36 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Thu, 24 Oct 2019 12:30:19 +0200 Subject: [PATCH] ENABLE_THUMBNAIL_GENERATOR -> Fixed flickering of 3D view when generating thumbnail --- src/slic3r/GUI/GLCanvas3D.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 8d16187cb8..a99b210acf 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -1697,10 +1697,9 @@ void GLCanvas3D::render_thumbnail(ThumbnailData& thumbnail_data, unsigned int w, glsafe(::glDisable(GL_LIGHTING)); glsafe(::glReadPixels(0, 0, thumbnail_data.width, thumbnail_data.height, GL_RGBA, GL_UNSIGNED_BYTE, (void*)thumbnail_data.pixels.data())); - std::cout << "Generated thumbnail " << thumbnail_data.width << "x" << thumbnail_data.height << std::endl; - - // force a frame render to restore the default framebuffer - render(); + // restore the framebuffer size to avoid flickering on the 3D scene + const Size& cnv_size = get_canvas_size(); + m_camera.apply_viewport(0, 0, cnv_size.get_width(), cnv_size.get_height()); } #endif // ENABLE_THUMBNAIL_GENERATOR