diff options
author | Enrico Turri <enricoturri@seznam.cz> | 2019-10-24 13:30:19 +0300 |
---|---|---|
committer | Enrico Turri <enricoturri@seznam.cz> | 2019-10-24 13:30:19 +0300 |
commit | 1baa3336633bd4b596179310c4e0306e94155e36 (patch) | |
tree | 2ad458fc07a5fb8a885e20699ff81a145b5f2cfc /src | |
parent | d01532f4c682abd16a37cd0bff1f330911114d2b (diff) |
ENABLE_THUMBNAIL_GENERATOR -> Fixed flickering of 3D view when generating thumbnail
Diffstat (limited to 'src')
-rw-r--r-- | src/slic3r/GUI/GLCanvas3D.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 8d16187cb..a99b210ac 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 |