mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 20:19:09 +08:00
Follow-up of a5b202aa1d28c0c3280f42f63b9af0bc394d4ca9 (fixed cleanup of toolpaths in preview after scene update)
This commit is contained in:
parent
de65d369a4
commit
f249155340
@ -186,6 +186,7 @@ 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)
|
||||
, m_volumes_cleanup_required(false)
|
||||
{
|
||||
if (init(parent, bed, camera, view_toolbar))
|
||||
{
|
||||
@ -363,16 +364,20 @@ void Preview::load_print()
|
||||
load_print_as_sla();
|
||||
}
|
||||
|
||||
void Preview::reload_print(bool force, bool keep_volumes)
|
||||
void Preview::reload_print(bool keep_volumes)
|
||||
{
|
||||
if (!IsShown() && !force)
|
||||
if (!IsShown())
|
||||
{
|
||||
m_volumes_cleanup_required = !keep_volumes;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!keep_volumes)
|
||||
if (m_volumes_cleanup_required || !keep_volumes)
|
||||
{
|
||||
m_canvas->reset_volumes();
|
||||
m_canvas->reset_legend_texture();
|
||||
m_loaded = false;
|
||||
m_volumes_cleanup_required = false;
|
||||
}
|
||||
|
||||
load_print();
|
||||
|
@ -86,6 +86,8 @@ class Preview : public wxPanel
|
||||
BackgroundSlicingProcess* m_process;
|
||||
GCodePreviewData* m_gcode_preview_data;
|
||||
|
||||
bool m_volumes_cleanup_required;
|
||||
|
||||
// Calling this function object forces Plater::schedule_background_process.
|
||||
std::function<void()> m_schedule_background_process;
|
||||
|
||||
@ -112,7 +114,7 @@ public:
|
||||
void set_drop_target(wxDropTarget* target);
|
||||
|
||||
void load_print();
|
||||
void reload_print(bool force = false, bool keep_volumes = false);
|
||||
void reload_print(bool keep_volumes = false);
|
||||
void refresh_print();
|
||||
|
||||
private:
|
||||
|
@ -2388,7 +2388,7 @@ void Plater::priv::set_current_panel(wxPanel* panel)
|
||||
{
|
||||
this->q->reslice();
|
||||
// keeps current gcode preview, if any
|
||||
preview->reload_print(false, true);
|
||||
preview->reload_print(true);
|
||||
preview->set_canvas_as_dirty();
|
||||
view_toolbar.select_item("Preview");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user