FIX: Scale coordinate display axis is wrong after the rotation

STUDIO-2658

Change-Id: Ie3659ac29bdbc6f908fbd6fc3463d4498b1a1bbb
This commit is contained in:
zhimin.zeng 2023-06-05 18:01:40 +08:00 committed by Lane.Wei
parent 0162f5f75a
commit dde886aae8
2 changed files with 7 additions and 5 deletions

View File

@ -2423,9 +2423,10 @@ void ModelObject::bake_xy_rotation_into_meshes(size_t instance_idx)
assert(instance_idx < this->instances.size()); assert(instance_idx < this->instances.size());
const Geometry::Transformation reference_trafo = this->instances[instance_idx]->get_transformation(); const Geometry::Transformation reference_trafo = this->instances[instance_idx]->get_transformation();
if (Geometry::is_rotation_ninety_degrees(reference_trafo.get_rotation())) // BBS: As long as the rotation value changed, the rotation angle will be applied to the mesh.
// nothing to do, scaling in the world coordinate space is possible in the representation of Geometry::Transformation. //if (Geometry::is_rotation_ninety_degrees(reference_trafo.get_rotation()))
return; // // nothing to do, scaling in the world coordinate space is possible in the representation of Geometry::Transformation.
// return;
bool left_handed = reference_trafo.is_left_handed(); bool left_handed = reference_trafo.is_left_handed();
bool has_mirrorring = ! reference_trafo.get_mirror().isApprox(Vec3d(1., 1., 1.)); bool has_mirrorring = ! reference_trafo.get_mirror().isApprox(Vec3d(1., 1., 1.));

View File

@ -452,7 +452,8 @@ void GizmoObjectManipulation::set_uniform_scaling(const bool new_value)
// all volumes in the selection belongs to the same instance, any of them contains the needed instance data, so we take the first one // all volumes in the selection belongs to the same instance, any of them contains the needed instance data, so we take the first one
const GLVolume* volume = selection.get_volume(*selection.get_volume_idxs().begin()); const GLVolume* volume = selection.get_volume(*selection.get_volume_idxs().begin());
// Is the angle close to a multiple of 90 degrees? // Is the angle close to a multiple of 90 degrees?
if (! Geometry::is_rotation_ninety_degrees(volume->get_instance_rotation())) { // BBS: As long as the rotation value changed, the rotation angle will be applied to the mesh.
// if (! Geometry::is_rotation_ninety_degrees(volume->get_instance_rotation())) {
// Cannot apply scaling in the world coordinate system. // Cannot apply scaling in the world coordinate system.
// BBS: remove tilt prompt dialog // BBS: remove tilt prompt dialog
@ -462,7 +463,7 @@ void GizmoObjectManipulation::set_uniform_scaling(const bool new_value)
wxGetApp().plater()->update(); wxGetApp().plater()->update();
// Recalculate cached values at this panel, refresh the screen. // Recalculate cached values at this panel, refresh the screen.
this->UpdateAndShow(true); this->UpdateAndShow(true);
} // }
} }
m_uniform_scale = new_value; m_uniform_scale = new_value;
} }