3fix: load, paste, modifiers

* now erase all previous data (perimeters, fills) when a lregion merge back with an other one
 * fix legacy parse of z_steps_per_mm
 * fix pasting of settings over nothing: now doesn't trigger assert but a warning
This commit is contained in:
supermerill 2021-05-31 14:46:28 +02:00 committed by remi durand
parent fd8df90ad0
commit 0449a49665
3 changed files with 11 additions and 1 deletions

View File

@ -206,6 +206,10 @@ void Layer::make_perimeters()
slices[surface.extra_perimeters].emplace_back(surface);
if (layerm->region()->config().fill_density > layerm_config->region()->config().fill_density)
layerm_config = layerm;
//clean list as only the layerm_config will have these ones recomputed
layerm->perimeters.clear();
layerm->thin_fills.clear();
layerm->fill_no_overlap_expolygons.clear();
}
// merge the surfaces assigned to each group
for (std::pair<const unsigned short,Surfaces> &surfaces_with_extra_perimeters : slices)

View File

@ -5239,7 +5239,8 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
} else if (opt_key == "z_steps_per_mm") {
opt_key = "z_step";
float v = boost::lexical_cast<float>(value);
value = boost::lexical_cast<std::string>(1/v);
if(v > 0)
value = boost::lexical_cast<std::string>(1/v);
} else if (opt_key == "infill_not_connected") {
opt_key = "infill_connection";
if (value == "1")

View File

@ -786,6 +786,11 @@ void ObjectList::copy_settings_to_clipboard()
void ObjectList::paste_settings_into_list()
{
wxDataViewItem item = GetSelection();
if (!item.IsOk()) {
BOOST_LOG_TRIVIAL(error) << "Warning: can't paste settings on empty selection\n";
return;
}
assert(item.IsOk());
if (m_objects_model->GetItemType(item) & itSettings)
item = m_objects_model->GetParent(item);