diff --git a/src/libslic3r/SLAPrint.cpp b/src/libslic3r/SLAPrint.cpp index f7cb0a8a4a..f25087cbec 100644 --- a/src/libslic3r/SLAPrint.cpp +++ b/src/libslic3r/SLAPrint.cpp @@ -354,14 +354,18 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model, const DynamicPrintConf std::vector new_instances = sla_instances(model_object); if (it_print_object_status != print_object_status.end() && it_print_object_status->status != PrintObjectStatus::Deleted) { // The SLAPrintObject is already there. - if (new_instances != it_print_object_status->print_object->instances()) { - // Instances changed. - it_print_object_status->print_object->set_instances(new_instances); - update_apply_status(this->invalidate_step(slapsRasterize)); - } - print_objects_new.emplace_back(it_print_object_status->print_object); - const_cast(*it_print_object_status).status = PrintObjectStatus::Reused; - } else { + if (new_instances.empty()) { + const_cast(*it_print_object_status).status = PrintObjectStatus::Deleted; + } else { + if (new_instances != it_print_object_status->print_object->instances()) { + // Instances changed. + it_print_object_status->print_object->set_instances(new_instances); + update_apply_status(this->invalidate_step(slapsRasterize)); + } + print_objects_new.emplace_back(it_print_object_status->print_object); + const_cast(*it_print_object_status).status = PrintObjectStatus::Reused; + } + } else if (! new_instances.empty()) { auto print_object = new SLAPrintObject(this, &model_object); // FIXME: this invalidates the transformed mesh in SLAPrintObject @@ -532,8 +536,8 @@ void SLAPrint::process() this->throw_if_canceled(); SLAAutoSupports::Config config; const SLAPrintObjectConfig& cfg = po.config(); - config.density_relative = (float)cfg.support_points_density_relative / 100.f; // the config value is in percents - config.minimal_distance = cfg.support_points_minimal_distance; + config.density_relative = float(cfg.support_points_density_relative / 100.f); // the config value is in percents + config.minimal_distance = float(cfg.support_points_minimal_distance); // Construction of this object does the calculation. this->throw_if_canceled(); @@ -916,7 +920,7 @@ void SLAPrint::process() BOOST_LOG_TRIVIAL(info) << "Slicing object " << po->model_object()->name; - for(int s = step_ranges[idx_range]; s < step_ranges[idx_range + 1]; ++s) { + for (int s = (int)step_ranges[idx_range]; s < (int)step_ranges[idx_range + 1]; ++s) { auto currentstep = (SLAPrintObjectStep)s; // Cancellation checking. Each step will check for cancellation diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index f7d1e26d83..50ca682a4b 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -108,6 +108,7 @@ wxFrame(NULL, wxID_ANY, SLIC3R_BUILD, wxDefaultPosition, wxDefaultSize, wxDEFAUL Bind(wxEVT_ACTIVATE, [this](wxActivateEvent& event) { if (m_plater != nullptr && event.GetActive()) m_plater->on_activate(); + event.Skip(); }); wxGetApp().persist_window_geometry(this);