mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 07:05:57 +08:00
Tech ENABLE_WORLD_COORDINATE - Fixed rendering of selection bounding box
This commit is contained in:
parent
49fdf01319
commit
0f302a7106
@ -1848,27 +1848,7 @@ void Selection::render(float scale_factor)
|
|||||||
m_scale_factor = scale_factor;
|
m_scale_factor = scale_factor;
|
||||||
// render cumulative bounding box of selected volumes
|
// render cumulative bounding box of selected volumes
|
||||||
#if ENABLE_WORLD_COORDINATE
|
#if ENABLE_WORLD_COORDINATE
|
||||||
BoundingBoxf3 box;
|
const auto [box, trafo] = get_bounding_box_in_current_reference_system();
|
||||||
Transform3d trafo;
|
|
||||||
const ECoordinatesType coordinates_type = wxGetApp().obj_manipul()->get_coordinates_type();
|
|
||||||
if (coordinates_type == ECoordinatesType::World) {
|
|
||||||
box = get_bounding_box();
|
|
||||||
trafo = Transform3d::Identity();
|
|
||||||
}
|
|
||||||
else if (coordinates_type == ECoordinatesType::Local && is_single_volume_or_modifier()) {
|
|
||||||
const GLVolume& v = *get_first_volume();
|
|
||||||
box = v.bounding_box();
|
|
||||||
trafo = v.world_matrix();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
const Selection::IndicesList& ids = get_volume_idxs();
|
|
||||||
for (unsigned int id : ids) {
|
|
||||||
const GLVolume& v = *get_volume(id);
|
|
||||||
box.merge(v.transformed_convex_hull_bounding_box(v.get_volume_transformation().get_matrix()));
|
|
||||||
}
|
|
||||||
trafo = get_first_volume()->get_instance_transformation().get_matrix();
|
|
||||||
}
|
|
||||||
|
|
||||||
render_bounding_box(box, trafo, ColorRGB::WHITE());
|
render_bounding_box(box, trafo, ColorRGB::WHITE());
|
||||||
#else
|
#else
|
||||||
render_bounding_box(get_bounding_box(), ColorRGB::WHITE());
|
render_bounding_box(get_bounding_box(), ColorRGB::WHITE());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user