Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortamasmeszaros <meszaros.q@gmail.com>2021-01-04 22:33:17 +0300
committertamasmeszaros <meszaros.q@gmail.com>2021-01-04 22:33:17 +0300
commita62940191622d6bffe588437fbeccb9b6a92f65c (patch)
tree74c90630596b3a727ce27cdd65012945d1bf329c
parentf119b803418a1d8d880d05f8d0ebe1feebb5deb7 (diff)
Fix for "bed fill" discarding selected instance transformation.
fixes #5621
-rw-r--r--src/slic3r/GUI/Jobs/FillBedJob.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/slic3r/GUI/Jobs/FillBedJob.cpp b/src/slic3r/GUI/Jobs/FillBedJob.cpp
index 9286e4735..1948c8fbb 100644
--- a/src/slic3r/GUI/Jobs/FillBedJob.cpp
+++ b/src/slic3r/GUI/Jobs/FillBedJob.cpp
@@ -73,9 +73,14 @@ void FillBedJob::prepare()
// This is the maximum number of items, the real number will always be close but less.
int needed_items = (bed_area - fixed_area) / poly_area;
- ModelInstance *mi = model_object->instances[0];
+ int sel_id = m_plater->get_selection().get_instance_idx();
+ // if the selection is not a single instance, choose the first as template
+ sel_id = std::max(sel_id, 0);
+ ModelInstance *mi = model_object->instances[sel_id];
+ ArrangePolygon template_ap = get_arrange_poly(PtrWrapper{mi}, m_plater);
+
for (int i = 0; i < needed_items; ++i) {
- ArrangePolygon ap;
+ ArrangePolygon ap = template_ap;
ap.poly = m_selected.front().poly;
ap.bed_idx = arrangement::UNARRANGED;
ap.setter = [this, mi](const ArrangePolygon &p) {