FIX:uniform scale can't be deselected when selecting multiple objects

Change-Id: I4e9c18410ffe45d9db9743c5e0f9c90019c372a2
(cherry picked from commit 9c669cacfce6d23a69993f36e6aebb982fb6ee3b)
This commit is contained in:
zhimin.zeng 2023-01-05 15:56:16 +08:00 committed by Lane.Wei
parent 49673b56e3
commit 3651d4ec15
3 changed files with 21 additions and 16 deletions

View file

@ -356,7 +356,8 @@ void GizmoObjectManipulation::do_scale(int axis, const Vec3d &scale) const
transformation_type.set_local();
}
if (m_uniform_scale || selection.requires_uniform_scale())
// BBS: when select multiple objects, uniform scale can be deselected
if (m_uniform_scale/* || selection.requires_uniform_scale()*/)
scaling_factor = scale(axis) * Vec3d::Ones();
selection.start_dragging();
@ -883,16 +884,18 @@ void GizmoObjectManipulation::do_render_scale_input_window(ImGuiWrapper* imgui_w
bool uniform_scale = this->m_uniform_scale;
const Selection &selection = m_glcanvas.get_selection();
bool uniform_scale_only = selection.is_multiple_full_object() || selection.is_multiple_full_instance() || selection.is_mixed() || selection.is_multiple_volume() || selection.is_multiple_modifier();
// BBS: when select multiple objects, uniform scale can be deselected
//const Selection &selection = m_glcanvas.get_selection();
//bool uniform_scale_only = selection.is_multiple_full_object() || selection.is_multiple_full_instance() || selection.is_mixed() || selection.is_multiple_volume() ||
// selection.is_multiple_modifier();
if (uniform_scale_only) {
imgui_wrapper->disabled_begin(true);
imgui_wrapper->bbl_checkbox(_L("uniform scale"), uniform_scale_only);
imgui_wrapper->disabled_end();
} else {
//if (uniform_scale_only) {
// imgui_wrapper->disabled_begin(true);
// imgui_wrapper->bbl_checkbox(_L("uniform scale"), uniform_scale_only);
// imgui_wrapper->disabled_end();
//} else {
imgui_wrapper->bbl_checkbox(_L("uniform scale"), uniform_scale);
}
//}
if (uniform_scale != this->m_uniform_scale) { this->set_uniform_scaling(uniform_scale); }
// for (int index = 0; index < 3; index++)