Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEnrico Turri <enricoturri@seznam.cz>2019-10-24 13:30:19 +0300
committerEnrico Turri <enricoturri@seznam.cz>2019-10-24 13:30:19 +0300
commit1baa3336633bd4b596179310c4e0306e94155e36 (patch)
tree2ad458fc07a5fb8a885e20699ff81a145b5f2cfc /src
parentd01532f4c682abd16a37cd0bff1f330911114d2b (diff)
ENABLE_THUMBNAIL_GENERATOR -> Fixed flickering of 3D view when generating thumbnail
Diffstat (limited to 'src')
-rw-r--r--src/slic3r/GUI/GLCanvas3D.cpp7
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