From bbcdebf5b52e59cfa6525f4561ebebb4c2e11d1b Mon Sep 17 00:00:00 2001 From: Joseph Lenox Date: Mon, 7 May 2018 22:36:40 -0500 Subject: [PATCH] more work on arrange() --- src/GUI/Plater.cpp | 6 +++++- src/GUI/Plater.hpp | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/GUI/Plater.cpp b/src/GUI/Plater.cpp index 0af673ff3..6336fc3f1 100644 --- a/src/GUI/Plater.cpp +++ b/src/GUI/Plater.cpp @@ -374,14 +374,18 @@ void Plater::refresh_canvases() { void Plater::arrange() { // pause background process + Slic3r::Log::info(LogChannel, L"Called arrange()"); auto bb {Slic3r::BoundingBoxf(this->config->get("bed_shape").values)}; - bool success {this->model->arrange_objects(this->config->min_object_distance(), &bb)}; + bool success {this->model->arrange_objects(5, &bb)}; GetFrame()->statusbar->SetStatusText(_("Objects were arranged.")); this->on_model_change(true); } void Plater::on_model_change(bool force_autocenter) { + if (force_autocenter || settings->autocenter) { + this->model->center_instances_around_point(this->bed_centerf()); + } this->refresh_canvases(); } diff --git a/src/GUI/Plater.hpp b/src/GUI/Plater.hpp index 5d052891f..74d892f1c 100644 --- a/src/GUI/Plater.hpp +++ b/src/GUI/Plater.hpp @@ -36,6 +36,9 @@ class Plater : public wxPanel public: Plater(wxWindow* parent, const wxString& title, std::shared_ptr _settings); void add(); + + /// Arrange models + void arrange(); /// Ask if there are any unsaved changes. bool prompt_unsaved_changes() { return true; } @@ -96,8 +99,6 @@ private: void on_thumbnail_made(size_t idx); void refresh_canvases(); - /// Arrange models - void arrange(); /// Run everything that needs to happen when models change. /// Includes updating canvases, reloading menus, etc.