diff --git a/resources/icons/view_toolbar.png b/resources/icons/view_toolbar.png index 349d0bd094..26202a2a42 100644 Binary files a/resources/icons/view_toolbar.png and b/resources/icons/view_toolbar.png differ diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 05ec54b126..f18b1e71cc 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -26,11 +26,7 @@ #include #include #include -#if ENABLE_REMOVE_TABS_FROM_PLATER -#include -#else #include -#endif // ENABLE_REMOVE_TABS_FROM_PLATER #include // Print now includes tbb, and tbb includes Windows. This breaks compilation of wxWidgets if included before wx. @@ -1034,6 +1030,7 @@ GLCanvas3D::Mouse::Mouse() , left_down(false) , position(DBL_MAX, DBL_MAX) , scene_position(DBL_MAX, DBL_MAX, DBL_MAX) + , ignore_up_event(false) { } @@ -4622,6 +4619,10 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) m_toolbar_action_running = true; m_toolbar.do_action((unsigned int)toolbar_contains_mouse); } + else if (evt.LeftDClick() && (m_gizmos.get_current_type() != Gizmos::Undefined)) + { + m_mouse.ignore_up_event = true; + } else if (evt.LeftDown() || evt.RightDown()) { m_mouse.left_down = evt.LeftDown(); @@ -4821,18 +4822,6 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) break; } -// if (!volumes.empty()) -// { -// BoundingBoxf3 bb; -// for (const GLVolume* volume : volumes) -// { -// bb.merge(volume->transformed_bounding_box()); -// } -// const Vec3d& size = bb.size(); -// const Vec3d& scale = m_gizmos.get_scale(); -// post_event(Vec3dsEvent<2>(EVT_GLCANVAS_UPDATE_GEOMETRY, {size, scale})); -// } - m_dirty = true; } else if (evt.Dragging() && !gizmos_overlay_contains_mouse) @@ -4908,7 +4897,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) else if (evt.LeftUp() && !m_mouse.dragging && (m_hover_volume_id == -1) && !gizmos_overlay_contains_mouse && !m_gizmos.is_dragging() && !is_layers_editing_enabled()) { // deselect and propagate event through callback - if (m_picking_enabled && !m_toolbar_action_running) + if (m_picking_enabled && !m_toolbar_action_running && !m_mouse.ignore_up_event) { m_selection.clear(); m_selection.set_mode(Selection::Instance); @@ -4916,6 +4905,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) post_event(SimpleEvent(EVT_GLCANVAS_OBJECT_SELECT)); _update_gizmos_data(); } + m_mouse.ignore_up_event = false; } else if (evt.LeftUp() && m_gizmos.is_dragging()) { diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index 8b19da8664..837b83e8a1 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -329,6 +329,7 @@ class GLCanvas3D Vec2d position; Vec3d scene_position; Drag drag; + bool ignore_up_event; Mouse(); diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index aa4415557a..f87f7c8c1c 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -854,7 +854,7 @@ void ObjectList::load_generic_subobject(const std::string& type_name, const int new_volume->set_type(static_cast(type)); #if ENABLE_MODELVOLUME_TRANSFORM - new_volume->set_offset((*m_objects)[obj_idx]->origin_translation + Vec3d(0.0, 0.0, -mesh.stl.stats.min(2))); + new_volume->set_offset(Vec3d(0.0, 0.0, (*m_objects)[obj_idx]->origin_translation(2) - mesh.stl.stats.min(2))); new_volume->center_geometry(); #endif // ENABLE_MODELVOLUME_TRANSFORM diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 663054cbac..59f191adb8 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2112,14 +2112,20 @@ void Plater::priv::set_current_panel(wxPanel* panel) return; current_panel = panel; + // to reduce flickering when changing view, first set as visible the new current panel for (wxPanel* p : panels) { - p->Show(p == current_panel); + if (p == current_panel) + p->Show(); + } + // then set to invisible the other + for (wxPanel* p : panels) + { + if (p != current_panel) + p->Hide(); } - q->Freeze(); panel_sizer->Layout(); - q->Thaw(); if (current_panel == view3D) { @@ -2479,7 +2485,7 @@ bool Plater::priv::init_object_menu() #if ENABLE_REMOVE_TABS_FROM_PLATER void Plater::priv::init_view_toolbar() { - if (!view_toolbar.init("view_toolbar.png", 36, 1, 1)) + if (!view_toolbar.init("view_toolbar.png", 64, 0, 0)) return; GLRadioToolbarItem::Data item;