Added method const GLVolume* Selection::get_first_volume() const to simplify client code

(cherry picked from commit prusa3d/PrusaSlicer@0e3490620e)
This commit is contained in:
enricoturri1966 2023-10-30 20:12:21 +08:00 committed by Noisyfox
parent 9dbb2dfe0d
commit 049dfd3e08
9 changed files with 29 additions and 30 deletions

View file

@ -119,7 +119,7 @@ void SelectionInfo::on_update()
const Selection& selection = get_pool()->get_canvas()->get_selection();
if (selection.is_single_full_instance()) {
m_model_object = selection.get_model()->objects[selection.get_object_idx()];
m_z_shift = selection.get_volume(*selection.get_volume_idxs().begin())->get_sla_shift_z();
m_z_shift = selection.get_first_volume()->get_sla_shift_z();
}
else
m_model_object = nullptr;