FIX:use full_unscaled_instance_bounding_box in world scale

jira: none
Change-Id: Ia42f7f2a0150d86be75d8fd86d045f3560f5ff07
This commit is contained in:
zhou.xu 2025-04-08 16:46:29 +08:00 committed by lane.wei
parent 26a6a413bf
commit c7f5569d75
2 changed files with 6 additions and 4 deletions

View File

@ -116,7 +116,7 @@ void GizmoObjectManipulation::update_settings_value(const Selection &selection)
delete_negative_sign(m_new_absolute_rotation);
if (is_world_coordinates()) {//for move and rotate
m_new_size = selection.get_bounding_box_in_current_reference_system().first.size();
m_unscale_size = selection.get_unscaled_instance_bounding_box().size();
m_unscale_size = selection.get_full_unscaled_instance_bounding_box().size();
m_new_scale = m_new_size.cwiseQuotient(m_unscale_size) * 100.0;
}
else {//if (is_local_coordinates()) {//for scale
@ -461,7 +461,7 @@ void GizmoObjectManipulation::do_scale(int axis, const Vec3d &scale) const
Vec3d scaling_factor = m_uniform_scale ? scale(axis) * Vec3d::Ones() : scale;
limit_scaling_ratio(scaling_factor);
selection.start_dragging();
selection.setup_cache();
selection.scale(scaling_factor, transformation_type);
m_glcanvas.do_scale(L("Set Scale"));
}

View File

@ -1001,9 +1001,11 @@ const std::pair<BoundingBoxf3, Transform3d> &Selection::get_bounding_box_in_curr
assert(!is_empty());
ECoordinatesType coordinates_type = wxGetApp().obj_manipul()->get_coordinates_type();
if (m_mode == Instance && coordinates_type == ECoordinatesType::Local) coordinates_type = ECoordinatesType::World;
if (m_mode == Instance && coordinates_type == ECoordinatesType::Local)
coordinates_type = ECoordinatesType::World;
if (last_coordinates_type != int(coordinates_type)) const_cast<std::optional<std::pair<BoundingBoxf3, Transform3d>> *>(&m_bounding_box_in_current_reference_system)->reset();
if (last_coordinates_type != int(coordinates_type))
const_cast<std::optional<std::pair<BoundingBoxf3, Transform3d>> *>(&m_bounding_box_in_current_reference_system)->reset();
if (!m_bounding_box_in_current_reference_system.has_value()) {
last_coordinates_type = int(coordinates_type);