From 9b3f1a89420902670071d13d37bd32c2ae432716 Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Thu, 28 Mar 2019 09:30:01 +0100 Subject: [PATCH] Small refactoring -> GLGizmosManager gets model from selection and not from canvas --- src/slic3r/GUI/GLCanvas3D.hpp | 1 - src/slic3r/GUI/Gizmos/GLGizmosManager.cpp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index 0f6333f73..489f3e237 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -465,7 +465,6 @@ public: void set_config(const DynamicPrintConfig* config); void set_process(BackgroundSlicingProcess* process); void set_model(Model* model); - Model* get_model() { return m_model; } const Selection& get_selection() const { return m_selection; } Selection& get_selection() { return m_selection; } diff --git a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp index 35bf2ef8a..7f4d4d495 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmosManager.cpp @@ -278,7 +278,7 @@ void GLGizmosManager::update_data(GLCanvas3D& canvas) const GLVolume* volume = selection.get_volume(*selection.get_volume_idxs().begin()); set_scale(volume->get_instance_scaling_factor()); set_rotation(Vec3d::Zero()); - ModelObject* model_object = canvas.get_model()->objects[selection.get_object_idx()]; + ModelObject* model_object = selection.get_model()->objects[selection.get_object_idx()]; set_flattening_data(model_object); set_sla_support_data(model_object, selection); } @@ -294,7 +294,7 @@ void GLGizmosManager::update_data(GLCanvas3D& canvas) { set_scale(Vec3d::Ones()); set_rotation(Vec3d::Zero()); - set_flattening_data(selection.is_from_single_object() ? canvas.get_model()->objects[selection.get_object_idx()] : nullptr); + set_flattening_data(selection.is_from_single_object() ? selection.get_model()->objects[selection.get_object_idx()] : nullptr); set_sla_support_data(nullptr, selection); } }