Fix and optimization of the previous commit.

This commit is contained in:
bubnikv 2019-03-21 11:54:25 +01:00
parent 213ff2852a
commit f76880cd5e

View File

@ -174,7 +174,9 @@ Preview::Preview(wxWindow* parent, Bed3D& bed, Camera& camera, GLToolbar& view_t
, m_loaded(false)
, m_enabled(false)
, m_schedule_background_process(schedule_background_process_func)
#ifdef __linux__
, m_volumes_cleanup_required(false)
#endif // __linux__
{
if (init(parent, bed, camera, view_toolbar))
{
@ -362,21 +364,19 @@ void Preview::reload_print(bool keep_volumes)
m_volumes_cleanup_required = !keep_volumes;
return;
}
if (m_volumes_cleanup_required || !keep_volumes)
if (
#ifdef __linux__
m_volumes_cleanup_required ||
#endif /* __linux__ */
!keep_volumes)
{
m_canvas->reset_volumes();
m_canvas->reset_legend_texture();
m_loaded = false;
#ifdef __linux__
m_volumes_cleanup_required = false;
#endif /* __linux__ */
}
#else // __linux__
if (!keep_volumes)
{
m_canvas->reset_volumes();
m_canvas->reset_legend_texture();
m_loaded = false;
}
#endif // __linux__
load_print();
}