mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
FIX: [STUDIO-2492] Model Centering Problem
Click on Add in the top menu bar, the model is not centered Change-Id: I950ce13262090ada316d5c350af8c7edc9826222
This commit is contained in:
parent
92d764e9ee
commit
f40851ff31
1 changed files with 8 additions and 2 deletions
|
@ -3799,8 +3799,14 @@ std::vector<size_t> Plater::priv::load_model_objects(const ModelObjectPtrs& mode
|
|||
for (auto& instance : new_instances) {
|
||||
auto offset = instance->get_offset();
|
||||
auto start_point = this->bed.build_volume().bounding_volume2d().center();
|
||||
bool plate_empty = partplate_list.get_curr_plate()->empty();
|
||||
Vec3d displacement;
|
||||
if (plate_empty)
|
||||
displacement = {start_point(0), start_point(1), offset(2)};
|
||||
else {
|
||||
auto empty_cell = wxGetApp().plater()->canvas3D()->get_nearest_empty_cell({start_point(0), start_point(1)});
|
||||
Vec3d displacement = { empty_cell.x(),empty_cell.y(),offset(2)};
|
||||
displacement = {empty_cell.x(), empty_cell.y(), offset(2)};
|
||||
}
|
||||
instance->set_offset(displacement);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue