From 4e4760bb8255d7c096ebef33893b7bf781e8d703 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Fri, 30 Nov 2018 10:59:00 +0100 Subject: [PATCH 1/6] Fixed translation of volumes belonging to scaled instances --- src/slic3r/GUI/GLCanvas3D.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 7c03b0441..2d2d296b7 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -1467,7 +1467,7 @@ void GLCanvas3D::Selection::translate(const Vec3d& displacement) (*m_volumes)[i]->set_instance_offset(m_cache.volumes_data[i].get_instance_position() + displacement); else if (m_mode == Volume) { - Vec3d local_displacement = m_cache.volumes_data[i].get_instance_rotation_matrix().inverse() * displacement; + Vec3d local_displacement = (m_cache.volumes_data[i].get_instance_rotation_matrix() * m_cache.volumes_data[i].get_instance_scale_matrix()).inverse() * displacement; (*m_volumes)[i]->set_volume_offset(m_cache.volumes_data[i].get_volume_position() + local_displacement); } #else From 4bb771683dfb6f7efa354167b2ffec5779a03c77 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Thu, 29 Nov 2018 15:42:33 +0100 Subject: [PATCH 2/6] Fixed assert message after wxAutoBufferedPaintDC and warnings in 2DBed.cpp --- src/slic3r/GUI/2DBed.cpp | 22 +++++++++++----------- src/slic3r/GUI/2DBed.hpp | 1 + 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/slic3r/GUI/2DBed.cpp b/src/slic3r/GUI/2DBed.cpp index 3c4bf2f0b..c90d54cb0 100644 --- a/src/slic3r/GUI/2DBed.cpp +++ b/src/slic3r/GUI/2DBed.cpp @@ -67,7 +67,7 @@ void Bed_2D::repaint() shift(1) - (cbb.max(1) - GetSize().GetHeight())); // draw bed fill - dc.SetBrush(wxBrush(wxColour(255, 255, 255), wxSOLID)); + dc.SetBrush(wxBrush(wxColour(255, 255, 255), wxBRUSHSTYLE_SOLID)); wxPointList pt_list; for (auto pt: m_bed_shape) { @@ -87,7 +87,7 @@ void Bed_2D::repaint() } polylines = intersection_pl(polylines, bed_polygon); - dc.SetPen(wxPen(wxColour(230, 230, 230), 1, wxSOLID)); + dc.SetPen(wxPen(wxColour(230, 230, 230), 1, wxPENSTYLE_SOLID)); for (auto pl : polylines) { for (size_t i = 0; i < pl.points.size()-1; i++) { @@ -98,8 +98,8 @@ void Bed_2D::repaint() } // draw bed contour - dc.SetPen(wxPen(wxColour(0, 0, 0), 1, wxSOLID)); - dc.SetBrush(wxBrush(wxColour(0, 0, 0), wxTRANSPARENT)); + dc.SetPen(wxPen(wxColour(0, 0, 0), 1, wxPENSTYLE_SOLID)); + dc.SetBrush(wxBrush(wxColour(0, 0, 0), wxBRUSHSTYLE_TRANSPARENT)); dc.DrawPolygon(&pt_list, 0, 0); auto origin_px = to_pixels(Vec2d(0, 0)); @@ -108,7 +108,7 @@ void Bed_2D::repaint() auto axes_len = 50; auto arrow_len = 6; auto arrow_angle = Geometry::deg2rad(45.0); - dc.SetPen(wxPen(wxColour(255, 0, 0), 2, wxSOLID)); // red + dc.SetPen(wxPen(wxColour(255, 0, 0), 2, wxPENSTYLE_SOLID)); // red auto x_end = Vec2d(origin_px(0) + axes_len, origin_px(1)); dc.DrawLine(wxPoint(origin_px(0), origin_px(1)), wxPoint(x_end(0), x_end(1))); for (auto angle : { -arrow_angle, arrow_angle }) { @@ -116,7 +116,7 @@ void Bed_2D::repaint() dc.DrawLine(wxPoint(x_end(0), x_end(1)), wxPoint(end(0), end(1))); } - dc.SetPen(wxPen(wxColour(0, 255, 0), 2, wxSOLID)); // green + dc.SetPen(wxPen(wxColour(0, 255, 0), 2, wxPENSTYLE_SOLID)); // green auto y_end = Vec2d(origin_px(0), origin_px(1) - axes_len); dc.DrawLine(wxPoint(origin_px(0), origin_px(1)), wxPoint(y_end(0), y_end(1))); for (auto angle : { -arrow_angle, arrow_angle }) { @@ -125,13 +125,13 @@ void Bed_2D::repaint() } // draw origin - dc.SetPen(wxPen(wxColour(0, 0, 0), 1, wxSOLID)); - dc.SetBrush(wxBrush(wxColour(0, 0, 0), wxSOLID)); + dc.SetPen(wxPen(wxColour(0, 0, 0), 1, wxPENSTYLE_SOLID)); + dc.SetBrush(wxBrush(wxColour(0, 0, 0), wxBRUSHSTYLE_SOLID)); dc.DrawCircle(origin_px(0), origin_px(1), 3); static const auto origin_label = wxString("(0,0)"); dc.SetTextForeground(wxColour(0, 0, 0)); - dc.SetFont(wxFont(10, wxDEFAULT, wxNORMAL, wxNORMAL)); + dc.SetFont(wxFont(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL)); auto extent = dc.GetTextExtent(origin_label); const auto origin_label_x = origin_px(0) <= cw / 2 ? origin_px(0) + 1 : origin_px(0) - 1 - extent.GetWidth(); const auto origin_label_y = origin_px(1) <= ch / 2 ? origin_px(1) + 1 : origin_px(1) - 1 - extent.GetHeight(); @@ -140,8 +140,8 @@ void Bed_2D::repaint() // draw current position if (m_pos!= Vec2d(0, 0)) { auto pos_px = to_pixels(m_pos); - dc.SetPen(wxPen(wxColour(200, 0, 0), 2, wxSOLID)); - dc.SetBrush(wxBrush(wxColour(200, 0, 0), wxTRANSPARENT)); + dc.SetPen(wxPen(wxColour(200, 0, 0), 2, wxPENSTYLE_SOLID)); + dc.SetBrush(wxBrush(wxColour(200, 0, 0), wxBRUSHSTYLE_TRANSPARENT)); dc.DrawCircle(pos_px(0), pos_px(1), 5); dc.DrawLine(pos_px(0) - 15, pos_px(1), pos_px(0) + 15, pos_px(1)); diff --git a/src/slic3r/GUI/2DBed.hpp b/src/slic3r/GUI/2DBed.hpp index fefccb403..463561953 100644 --- a/src/slic3r/GUI/2DBed.hpp +++ b/src/slic3r/GUI/2DBed.hpp @@ -28,6 +28,7 @@ public: Bed_2D(wxWindow* parent) { Create(parent, wxID_ANY, wxDefaultPosition, wxSize(250, -1), wxTAB_TRAVERSAL); + SetBackgroundStyle(wxBG_STYLE_PAINT); // to avoid assert message after wxAutoBufferedPaintDC // m_user_drawn_background = $^O ne 'darwin'; #ifdef __APPLE__ m_user_drawn_background = false; From 054d20281718631efdac87187fb8d36d948a1079 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Fri, 30 Nov 2018 11:21:25 +0100 Subject: [PATCH 3/6] Correct mixed_selection updating from 3dScene to ObjectList --- src/slic3r/GUI/Field.hpp | 1 + src/slic3r/GUI/GLCanvas3D.hpp | 2 ++ src/slic3r/GUI/GUI_ObjectList.cpp | 35 +++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/src/slic3r/GUI/Field.hpp b/src/slic3r/GUI/Field.hpp index 515a95559..aef2094a7 100644 --- a/src/slic3r/GUI/Field.hpp +++ b/src/slic3r/GUI/Field.hpp @@ -128,6 +128,7 @@ public: Field(const ConfigOptionDef& opt, const t_config_option_key& id) : m_opt(opt), m_opt_id(id) {}; Field(wxWindow* parent, const ConfigOptionDef& opt, const t_config_option_key& id) : m_parent(parent), m_opt(opt), m_opt_id(id) {}; + virtual ~Field() {} /// If you don't know what you are getting back, check both methods for nullptr. virtual wxSizer* getSizer() { return nullptr; } diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index 3caa3be3d..3cd62162a 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -519,6 +519,8 @@ public: const IndicesList& get_volume_idxs() const { return m_list; } const GLVolume* get_volume(unsigned int volume_idx) const; + const ObjectIdxsToInstanceIdxsMap& get_content() const { return m_cache.content; } + unsigned int volumes_count() const { return (unsigned int)m_list.size(); } const BoundingBoxf3& get_bounding_box() const; diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 920db9581..3c8efbf22 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -1358,6 +1358,41 @@ void ObjectList::update_selections() sels.Add(m_objects_model->GetItemByInstanceId(selection.get_object_idx(), idx)); } } + else if (selection.is_mixed()) + { + auto& objects_content_list = selection.get_content(); + + for (auto idx : selection.get_volume_idxs()) { + const auto gl_vol = selection.get_volume(idx); + const auto& glv_obj_idx = gl_vol->object_idx(); + const auto& glv_ins_idx = gl_vol->instance_idx(); + + bool is_selected = false; + + for (auto obj_ins : objects_content_list) { + if (obj_ins.first == glv_obj_idx) { + if (obj_ins.second.find(glv_ins_idx) != obj_ins.second.end()) { + if (glv_ins_idx == 0 && (*m_objects)[glv_obj_idx]->instances.size() == 1) + sels.Add(m_objects_model->GetItemById(glv_obj_idx)); + else + sels.Add(m_objects_model->GetItemByInstanceId(glv_obj_idx, glv_ins_idx)); + + is_selected = true; + break; + } + } + } + + if (is_selected) + continue; + + const auto& glv_vol_idx = gl_vol->volume_idx(); + if (glv_vol_idx == 0 && (*m_objects)[glv_obj_idx]->volumes.size() == 1) + sels.Add(m_objects_model->GetItemById(glv_obj_idx)); + else + sels.Add(m_objects_model->GetItemByVolumeId(glv_obj_idx, glv_vol_idx)); + } + } select_items(sels); } From b83468e76332095746ba6325035e121a18bcef0e Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Fri, 30 Nov 2018 11:42:36 +0100 Subject: [PATCH 4/6] Removed gizmo reset by double-cliking on grabbers --- src/libslic3r/Technologies.hpp | 2 -- src/slic3r/GUI/GLCanvas3D.cpp | 58 ---------------------------------- src/slic3r/GUI/GLCanvas3D.hpp | 6 ---- src/slic3r/GUI/GLGizmo.cpp | 10 +----- src/slic3r/GUI/GLGizmo.hpp | 24 -------------- 5 files changed, 1 insertion(+), 99 deletions(-) diff --git a/src/libslic3r/Technologies.hpp b/src/libslic3r/Technologies.hpp index 868003a45..43c834378 100644 --- a/src/libslic3r/Technologies.hpp +++ b/src/libslic3r/Technologies.hpp @@ -13,8 +13,6 @@ //============= #define ENABLE_1_42_0 1 -// Add double click on gizmo grabbers to reset transformation components to their default value -#define ENABLE_GIZMOS_RESET (1 && ENABLE_1_42_0) // Uses a unique opengl context #define ENABLE_USE_UNIQUE_GLCONTEXT (1 && ENABLE_1_42_0) // Disable synchronization of unselected instances diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 2d2d296b7..00738beaf 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -1047,9 +1047,6 @@ GLCanvas3D::Mouse::Mouse() #if ENABLE_GIZMOS_ON_TOP , scene_position(DBL_MAX, DBL_MAX, DBL_MAX) #endif // ENABLE_GIZMOS_ON_TOP -#if ENABLE_GIZMOS_RESET - , ignore_up_event(false) -#endif // ENABLE_GIZMOS_RESET { } @@ -2691,18 +2688,6 @@ void GLCanvas3D::Gizmos::update(const Linef3& mouse_ray, bool shift_down, const curr->update(GLGizmoBase::UpdateData(mouse_ray, mouse_pos, shift_down)); } -#if ENABLE_GIZMOS_RESET -void GLCanvas3D::Gizmos::process_double_click() -{ - if (!m_enabled) - return; - - GLGizmoBase* curr = _get_current(); - if (curr != nullptr) - curr->process_double_click(); -} -#endif // ENABLE_GIZMOS_RESET - GLCanvas3D::Gizmos::EType GLCanvas3D::Gizmos::get_current_type() const { return m_current; @@ -4546,38 +4531,6 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) m_toolbar_action_running = true; m_toolbar.do_action((unsigned int)toolbar_contains_mouse); } -#if ENABLE_GIZMOS_RESET - else if (evt.LeftDClick() && m_gizmos.grabber_contains_mouse()) - { - m_mouse.ignore_up_event = true; - m_gizmos.process_double_click(); - switch (m_gizmos.get_current_type()) - { - case Gizmos::Scale: - { - m_selection.scale(m_gizmos.get_scale(), false); - do_scale(); - wxGetApp().obj_manipul()->update_settings_value(m_selection); - m_dirty = true; - break; - } -#if !ENABLE_WORLD_ROTATIONS - case Gizmos::Rotate: - { - m_selection.rotate(m_gizmos.get_rotation(), false); - do_rotate(); - wxGetApp().obj_manipul()->update_settings_value(m_selection); - m_dirty = true; - break; - } -#endif // !ENABLE_WORLD_ROTATIONS - default: - { - break; - } - } - } -#endif // ENABLE_GIZMOS_RESET else if (evt.LeftDown() || evt.RightDown()) { // If user pressed left or right button we first check whether this happened @@ -4610,9 +4563,6 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) if (evt.LeftDown()) { m_gizmos.delete_current_grabber(true); -#if ENABLE_GIZMOS_RESET - m_mouse.ignore_up_event = true; -#endif // ENABLE_GIZMOS_RESET m_dirty = true; } } @@ -4871,11 +4821,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 ENABLE_GIZMOS_RESET - if (!m_mouse.ignore_up_event && m_picking_enabled && !m_toolbar_action_running) -#else if (m_picking_enabled && !m_toolbar_action_running) -#endif // ENABLE_GIZMOS_RESET { m_selection.clear(); m_selection.set_mode(Selection::Instance); @@ -4883,10 +4829,6 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) post_event(SimpleEvent(EVT_GLCANVAS_OBJECT_SELECT)); _update_gizmos_data(); } -#if ENABLE_GIZMOS_RESET - else if (m_mouse.ignore_up_event) - m_mouse.ignore_up_event = false; -#endif // ENABLE_GIZMOS_RESET } else if (evt.LeftUp() && m_gizmos.is_dragging()) { diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index 3cd62162a..b5e894202 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -328,9 +328,6 @@ class GLCanvas3D Vec3d scene_position; #endif // ENABLE_GIZMOS_ON_TOP Drag drag; -#if ENABLE_GIZMOS_RESET - bool ignore_up_event; -#endif // ENABLE_GIZMOS_RESET Mouse(); @@ -631,9 +628,6 @@ private: bool overlay_contains_mouse(const GLCanvas3D& canvas, const Vec2d& mouse_pos) const; bool grabber_contains_mouse() const; void update(const Linef3& mouse_ray, bool shift_down, const Point* mouse_pos = nullptr); -#if ENABLE_GIZMOS_RESET - void process_double_click(); -#endif // ENABLE_GIZMOS_RESET Rect get_reset_rect_viewport(const GLCanvas3D& canvas) const; EType get_current_type() const; diff --git a/src/slic3r/GUI/GLGizmo.cpp b/src/slic3r/GUI/GLGizmo.cpp index 8eeec682a..6eb057372 100644 --- a/src/slic3r/GUI/GLGizmo.cpp +++ b/src/slic3r/GUI/GLGizmo.cpp @@ -829,14 +829,6 @@ void GLGizmoScale3D::on_update(const UpdateData& data) do_scale_uniform(data); } -#if ENABLE_GIZMOS_RESET -void GLGizmoScale3D::on_process_double_click() -{ - if (m_hover_id >= 6) - m_scale = Vec3d::Ones(); -} -#endif // ENABLE_GIZMOS_RESET - void GLGizmoScale3D::on_render(const GLCanvas3D::Selection& selection) const { bool single_instance = selection.is_single_full_instance(); @@ -1352,7 +1344,7 @@ bool GLGizmoFlatten::on_init() std::string GLGizmoFlatten::on_get_name() const { - return L("Flatten"); + return L("Place on face"); } bool GLGizmoFlatten::on_is_activable(const GLCanvas3D::Selection& selection) const diff --git a/src/slic3r/GUI/GLGizmo.hpp b/src/slic3r/GUI/GLGizmo.hpp index ce5cfae0a..cedd4a67d 100644 --- a/src/slic3r/GUI/GLGizmo.hpp +++ b/src/slic3r/GUI/GLGizmo.hpp @@ -136,10 +136,6 @@ public: void update(const UpdateData& data); -#if ENABLE_GIZMOS_RESET - void process_double_click() { on_process_double_click(); } -#endif // ENABLE_GIZMOS_RESET - void render(const GLCanvas3D::Selection& selection) const { on_render(selection); } void render_for_picking(const GLCanvas3D::Selection& selection) const { on_render_for_picking(selection); } @@ -163,9 +159,6 @@ protected: virtual void on_start_dragging(const GLCanvas3D::Selection& selection) {} virtual void on_stop_dragging() {} virtual void on_update(const UpdateData& data) = 0; -#if ENABLE_GIZMOS_RESET - virtual void on_process_double_click() {} -#endif // ENABLE_GIZMOS_RESET virtual void on_render(const GLCanvas3D::Selection& selection) const = 0; virtual void on_render_for_picking(const GLCanvas3D::Selection& selection) const = 0; @@ -225,11 +218,6 @@ protected: virtual std::string on_get_name() const { return ""; } virtual void on_start_dragging(const GLCanvas3D::Selection& selection); virtual void on_update(const UpdateData& data); -#if ENABLE_GIZMOS_RESET -#if !ENABLE_WORLD_ROTATIONS - virtual void on_process_double_click() { m_angle = 0.0; } -#endif // !ENABLE_WORLD_ROTATIONS -#endif // ENABLE_GIZMOS_RESET virtual void on_render(const GLCanvas3D::Selection& selection) const; virtual void on_render_for_picking(const GLCanvas3D::Selection& selection) const; @@ -294,15 +282,6 @@ protected: g.update(data); } } -#if ENABLE_GIZMOS_RESET -#if !ENABLE_WORLD_ROTATIONS - virtual void on_process_double_click() - { - if (m_hover_id != -1) - m_gizmos[m_hover_id].process_double_click(); - } -#endif // !ENABLE_WORLD_ROTATIONS -#endif // ENABLE_GIZMOS_RESET virtual void on_render(const GLCanvas3D::Selection& selection) const; virtual void on_render_for_picking(const GLCanvas3D::Selection& selection) const { @@ -346,9 +325,6 @@ protected: virtual bool on_is_activable(const GLCanvas3D::Selection& selection) const { return !selection.is_wipe_tower(); } virtual void on_start_dragging(const GLCanvas3D::Selection& selection); virtual void on_update(const UpdateData& data); -#if ENABLE_GIZMOS_RESET - virtual void on_process_double_click(); -#endif // ENABLE_GIZMOS_RESET virtual void on_render(const GLCanvas3D::Selection& selection) const; virtual void on_render_for_picking(const GLCanvas3D::Selection& selection) const; From 918a7f8dddd39a12d89068ebd492eaa379fc408f Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Fri, 30 Nov 2018 12:49:31 +0100 Subject: [PATCH 5/6] Fixed lost selection when selecting object while place on face gizmo is active --- src/slic3r/GUI/GLCanvas3D.cpp | 9 +++++++-- src/slic3r/GUI/GLCanvas3D.hpp | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 00738beaf..0fe6832d5 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -1043,6 +1043,7 @@ GLCanvas3D::Mouse::Drag::Drag() GLCanvas3D::Mouse::Mouse() : dragging(false) + , left_down(false) , position(DBL_MAX, DBL_MAX) #if ENABLE_GIZMOS_ON_TOP , scene_position(DBL_MAX, DBL_MAX, DBL_MAX) @@ -4533,6 +4534,8 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) } else if (evt.LeftDown() || evt.RightDown()) { + m_mouse.left_down = evt.LeftDown(); + // If user pressed left or right button we first check whether this happened // on a volume or not. m_layers_editing.state = LayersEditing::Unknown; @@ -4596,6 +4599,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) { m_toolbar_action_running = true; m_toolbar.do_action((unsigned int)toolbar_contains_mouse); + m_mouse.left_down = false; } else { @@ -4614,7 +4618,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) m_selection.remove(m_hover_volume_id); else { - bool add_as_single = !already_selected && !evt.ShiftDown(); + bool add_as_single = !already_selected && !shift_down; m_selection.add(m_hover_volume_id, add_as_single); } @@ -4872,6 +4876,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt) m_mouse.set_start_position_3D_as_invalid(); m_mouse.set_start_position_2D_as_invalid(); m_mouse.dragging = false; + m_mouse.left_down = false; m_toolbar_action_running = false; m_dirty = true; @@ -5554,7 +5559,7 @@ void GLCanvas3D::_picking_pass() const { const Vec2d& pos = m_mouse.position; - if (m_picking_enabled && !m_mouse.dragging && (pos != Vec2d(DBL_MAX, DBL_MAX))) + if (m_picking_enabled && !m_mouse.dragging && !m_mouse.left_down && (pos != Vec2d(DBL_MAX, DBL_MAX))) { // Render the object for picking. // FIXME This cannot possibly work in a multi - sampled context as the color gets mangled by the anti - aliasing. diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index b5e894202..03e089157 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -323,6 +323,7 @@ class GLCanvas3D }; bool dragging; + bool left_down; Vec2d position; #if ENABLE_GIZMOS_ON_TOP Vec3d scene_position; From 1f3b9d06579ec4cdfed4d2be06de45ae2b00fb78 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Fri, 30 Nov 2018 13:27:54 +0100 Subject: [PATCH 6/6] Fixed vertical centering of gizmo overlay icons --- src/slic3r/GUI/GLCanvas3D.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index 0fe6832d5..2eb1464ba 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -2418,7 +2418,7 @@ void GLCanvas3D::Selection::_ensure_on_bed() } #endif // ENABLE_ENSURE_ON_BED_WHILE_SCALING -const float GLCanvas3D::Gizmos::OverlayTexturesScale = 0.75f; +const float GLCanvas3D::Gizmos::OverlayTexturesScale = 1.0f; const float GLCanvas3D::Gizmos::OverlayOffsetX = 10.0f * OverlayTexturesScale; const float GLCanvas3D::Gizmos::OverlayGapY = 5.0f * OverlayTexturesScale; @@ -2964,7 +2964,8 @@ float GLCanvas3D::Gizmos::_get_total_overlay_height() const { if (it->first == SlaSupports && wxGetApp().preset_bundle->printers.get_edited_preset().printer_technology() != ptSLA) continue; - height += (float)it->second->get_textures_size() + OverlayGapY; + + height += (float)it->second->get_textures_size() * OverlayTexturesScale + OverlayGapY; } return height - OverlayGapY;