From 9a640be43ce3ea4612c667f30667a9b43834f02d Mon Sep 17 00:00:00 2001 From: Stone Li Date: Tue, 26 Jul 2022 12:46:29 +0800 Subject: [PATCH] FIX: fix bug that thumbnail is not display Change-Id: Ic974e378fbcaea096f5e2aa8b40092d2ef3e8e54 --- src/slic3r/GUI/DeviceManager.cpp | 2 ++ src/slic3r/GUI/GLCanvas3D.cpp | 11 ++--------- src/slic3r/GUI/GLCanvas3D.hpp | 1 - 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 345900477..31cbc875c 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -2360,6 +2360,8 @@ void MachineObject::update_slice_info(std::string project_id, std::string profil if (plate_idx >= 0) { plate_index = plate_idx; } else { + if (subtask_id.compare("0") == 0) + return; m_agent->get_task_plate_index(subtask_id, &plate_index); } diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 4391c8d96..788969b2b 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -2133,7 +2133,6 @@ void GLCanvas3D::bind_event_handlers() m_canvas->Bind(wxEVT_RIGHT_DCLICK, &GLCanvas3D::on_mouse, this); m_canvas->Bind(wxEVT_PAINT, &GLCanvas3D::on_paint, this); m_canvas->Bind(wxEVT_SET_FOCUS, &GLCanvas3D::on_set_focus, this); - m_canvas->Bind(wxEVT_KILL_FOCUS, &GLCanvas3D::on_kill_focus, this); m_event_handlers_bound = true; } } @@ -2163,7 +2162,6 @@ void GLCanvas3D::unbind_event_handlers() m_canvas->Unbind(wxEVT_RIGHT_DCLICK, &GLCanvas3D::on_mouse, this); m_canvas->Unbind(wxEVT_PAINT, &GLCanvas3D::on_paint, this); m_canvas->Unbind(wxEVT_SET_FOCUS, &GLCanvas3D::on_set_focus, this); - m_canvas->Unbind(wxEVT_KILL_FOCUS, &GLCanvas3D::on_kill_focus, this); m_event_handlers_bound = false; } @@ -3484,19 +3482,14 @@ void GLCanvas3D::on_set_focus(wxFocusEvent& evt) { m_tooltip_enabled = false; if (m_canvas_type == ECanvasType::CanvasPreview) { + // update thumbnails and update plate toolbar + wxGetApp().plater()->update_platplate_thumbnails(); _update_imgui_select_plate_toolbar(); } _refresh_if_shown_on_screen(); m_tooltip_enabled = true; } -void GLCanvas3D::on_kill_focus(wxFocusEvent& evt) -{ - if (m_canvas_type == ECanvasType::CanvasView3D) { - wxGetApp().plater()->update_platplate_thumbnails(); - } -} - Size GLCanvas3D::get_canvas_size() const { int w = 0; diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index 1d37e85ff..50280ff74 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -767,7 +767,6 @@ public: void on_mouse(wxMouseEvent& evt); void on_paint(wxPaintEvent& evt); void on_set_focus(wxFocusEvent& evt); - void on_kill_focus(wxFocusEvent& evt); Size get_canvas_size() const; Vec2d get_local_mouse_position() const;