mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
ENABLE_THUMBNAIL_GENERATOR -> Fixed flickering of 3D view when generating thumbnail
This commit is contained in:
parent
d01532f4c6
commit
1baa333663
1 changed files with 3 additions and 4 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue