mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-13 20:05:59 +08:00
Fix problem with incorrect number of objects in object list after bedfil
fixes for problem reported in SPE-1824 (bug 2.)
This commit is contained in:
parent
0c0a1af1e9
commit
62c64fce2d
@ -58,9 +58,15 @@ public:
|
||||
typename decltype(std::declval<ArrangeTaskT>().process_native(
|
||||
std::declval<arr2::ArrangeTaskCtl>()))::element_type;
|
||||
|
||||
// All callbacks are called in the main thread.
|
||||
struct Callbacks {
|
||||
// Task is prepared but not no processing has been initiated
|
||||
std::function<void(ArrangeTaskT &)> on_prepared;
|
||||
|
||||
// Task has been completed but the result is not yet written (inside finalize)
|
||||
std::function<void(ArrangeTaskT &)> on_processed;
|
||||
|
||||
// Task result has been written
|
||||
std::function<void(ResultType &)> on_finished;
|
||||
};
|
||||
|
||||
|
@ -6279,7 +6279,7 @@ void Plater::fill_bed_with_instances()
|
||||
ModelObject *model_object = prototype_mi->get_object();
|
||||
assert(model_object);
|
||||
|
||||
// model_object->ensure_on_bed();
|
||||
model_object->ensure_on_bed();
|
||||
|
||||
size_t inst_cnt = model_object->instances.size();
|
||||
if (inst_cnt == 0)
|
||||
@ -6290,19 +6290,17 @@ void Plater::fill_bed_with_instances()
|
||||
if (object_idx < 0 || object_idx >= int(model().objects.size()))
|
||||
return;
|
||||
|
||||
int added_cnt = result.to_add.size();
|
||||
|
||||
if (added_cnt > 0) {
|
||||
update(static_cast<unsigned int>(UpdateParams::FORCE_FULL_SCREEN_REFRESH));
|
||||
|
||||
if (!result.to_add.empty()) {
|
||||
auto added_cnt = result.to_add.size();
|
||||
|
||||
// FIXME: somebody explain why this is needed for
|
||||
// increase_object_instances
|
||||
if (inst_cnt == 1)
|
||||
if (result.arranged_items.size() == 1)
|
||||
added_cnt++;
|
||||
|
||||
sidebar()
|
||||
.obj_list()
|
||||
->increase_object_instances(object_idx, size_t(added_cnt));
|
||||
sidebar().obj_list()->increase_object_instances(object_idx, added_cnt);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user