Cut WIP: some UI improvements

+ partially reverted 63890b5f8d
This commit is contained in:
YuSanka 2022-07-11 09:11:06 +02:00
parent 4b214598a2
commit 07d455a125
7 changed files with 84 additions and 28 deletions

View file

@ -301,13 +301,13 @@ void GLGizmoRotate::init_data_from_selection(const Selection& selection)
coordinates_type = wxGetApp().obj_manipul()->get_coordinates_type();
if (coordinates_type == ECoordinatesType::World) {
m_bounding_box = selection.get_bounding_box();
m_center = m_bounding_box.center();
m_center = m_has_forced_center ? m_forced_center : m_bounding_box.center();
}
else if (coordinates_type == ECoordinatesType::Local && selection.is_single_volume_or_modifier()) {
const GLVolume& v = *selection.get_first_volume();
m_bounding_box = v.transformed_convex_hull_bounding_box(
v.get_instance_transformation().get_scaling_factor_matrix() * v.get_volume_transformation().get_scaling_factor_matrix());
m_center = v.world_matrix() * m_bounding_box.center();
m_center = v.world_matrix() * (m_has_forced_center ? m_forced_center : m_bounding_box.center());
}
else {
m_bounding_box.reset();
@ -318,7 +318,7 @@ void GLGizmoRotate::init_data_from_selection(const Selection& selection)
}
const Geometry::Transformation inst_trafo = selection.get_first_volume()->get_instance_transformation();
m_bounding_box = m_bounding_box.transformed(inst_trafo.get_scaling_factor_matrix());
m_center = inst_trafo.get_matrix_no_scaling_factor() * m_bounding_box.center();
m_center = inst_trafo.get_matrix_no_scaling_factor() * (m_has_forced_center ? m_forced_center : m_bounding_box.center());
}
m_radius = Offset + m_bounding_box.radius();