mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-13 02:59:03 +08:00
ENABLE_THUMBNAIL_GENERATOR -> Fixed flickering of 3D view when generating thumbnail
This commit is contained in:
parent
d01532f4c6
commit
1baa333663
@ -1697,10 +1697,9 @@ void GLCanvas3D::render_thumbnail(ThumbnailData& thumbnail_data, unsigned int w,
|
|||||||
glsafe(::glDisable(GL_LIGHTING));
|
glsafe(::glDisable(GL_LIGHTING));
|
||||||
glsafe(::glReadPixels(0, 0, thumbnail_data.width, thumbnail_data.height, GL_RGBA, GL_UNSIGNED_BYTE, (void*)thumbnail_data.pixels.data()));
|
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;
|
// restore the framebuffer size to avoid flickering on the 3D scene
|
||||||
|
const Size& cnv_size = get_canvas_size();
|
||||||
// force a frame render to restore the default framebuffer
|
m_camera.apply_viewport(0, 0, cnv_size.get_width(), cnv_size.get_height());
|
||||||
render();
|
|
||||||
}
|
}
|
||||||
#endif // ENABLE_THUMBNAIL_GENERATOR
|
#endif // ENABLE_THUMBNAIL_GENERATOR
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user